aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext
diff options
context:
space:
mode:
authorNicholas Seckar <nseckar@gmail.com>2005-10-16 17:47:19 +0000
committerNicholas Seckar <nseckar@gmail.com>2005-10-16 17:47:19 +0000
commit57f43473d73906232340ccbb6b4651dfd99bc1eb (patch)
tree8e8b2ab6fe0a9835aff822031e64076287e5b72f /activesupport/lib/active_support/core_ext
parent98c1735f0313a08563d8cb92fcbff48b2be906fc (diff)
downloadrails-57f43473d73906232340ccbb6b4651dfd99bc1eb.tar.gz
rails-57f43473d73906232340ccbb6b4651dfd99bc1eb.tar.bz2
rails-57f43473d73906232340ccbb6b4651dfd99bc1eb.zip
Update Exception extension to show the first few framework frames in an application trace.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2654 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib/active_support/core_ext')
-rw-r--r--activesupport/lib/active_support/core_ext/exception.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/exception.rb b/activesupport/lib/active_support/core_ext/exception.rb
index 323d97aa44..5a2d21590b 100644
--- a/activesupport/lib/active_support/core_ext/exception.rb
+++ b/activesupport/lib/active_support/core_ext/exception.rb
@@ -13,6 +13,12 @@ class Exception
end
def application_backtrace
- clean_backtrace.reject { |line| line =~ /(vendor|dispatch|ruby|script\/\w+)/ }
+ before_application_frame = true
+
+ clean_backtrace.reject do |line|
+ non_app_frame = !! (line =~ /vendor|dispatch|ruby|script\/\w+/)
+ before_application_frame = false unless non_app_frame
+ non_app_frame && ! before_application_frame
+ end
end
end \ No newline at end of file