diff options
author | Nicholas Seckar <nseckar@gmail.com> | 2005-10-18 14:06:34 +0000 |
---|---|---|
committer | Nicholas Seckar <nseckar@gmail.com> | 2005-10-18 14:06:34 +0000 |
commit | 60b6fac5deec3317acaca8dc3d399faea25223b2 (patch) | |
tree | 2c9628661e6286baad8f9f81ec81781da1a8c66e /activesupport/lib/active_support/core_ext/exception.rb | |
parent | 851dd0806be4e21f9a4fdcc77162711f46095bc5 (diff) | |
download | rails-60b6fac5deec3317acaca8dc3d399faea25223b2.tar.gz rails-60b6fac5deec3317acaca8dc3d399faea25223b2.tar.bz2 rails-60b6fac5deec3317acaca8dc3d399faea25223b2.zip |
Remove generated code from app traces; improve accuracy of framework traces
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2676 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib/active_support/core_ext/exception.rb')
-rw-r--r-- | activesupport/lib/active_support/core_ext/exception.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/exception.rb b/activesupport/lib/active_support/core_ext/exception.rb index 5a2d21590b..2541f37495 100644 --- a/activesupport/lib/active_support/core_ext/exception.rb +++ b/activesupport/lib/active_support/core_ext/exception.rb @@ -3,6 +3,7 @@ class Exception alias :clean_message :message TraceSubstitutions = [] + FrameworkRegexp = /generated_code|vendor|dispatch|ruby|script\/\w+/ def clean_backtrace backtrace.collect do |line| @@ -16,9 +17,13 @@ class Exception before_application_frame = true clean_backtrace.reject do |line| - non_app_frame = !! (line =~ /vendor|dispatch|ruby|script\/\w+/) + non_app_frame = !! (line =~ FrameworkRegexp) before_application_frame = false unless non_app_frame non_app_frame && ! before_application_frame end end + + def framework_backtrace + clean_backtrace.select {|line| line =~ FrameworkRegexp} + end end
\ No newline at end of file |