aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/rescue.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_controller/rescue.rb')
-rw-r--r--actionpack/lib/action_controller/rescue.rb14
1 files changed, 4 insertions, 10 deletions
diff --git a/actionpack/lib/action_controller/rescue.rb b/actionpack/lib/action_controller/rescue.rb
index ec8e9b92d5..9c24c3def4 100644
--- a/actionpack/lib/action_controller/rescue.rb
+++ b/actionpack/lib/action_controller/rescue.rb
@@ -68,9 +68,8 @@ module ActionController #:nodoc:
logger.fatal(exception.to_s)
else
logger.fatal(
- "\n\n#{exception.class} (#{exception.message}):\n " +
- clean_backtrace(exception).join("\n ") +
- "\n\n"
+ "\n#{exception.class} (#{exception.message}):\n " +
+ clean_backtrace(exception).join("\n ") + "\n\n"
)
end
end
@@ -151,13 +150,8 @@ module ActionController #:nodoc:
end
def clean_backtrace(exception)
- if backtrace = exception.backtrace
- if defined?(RAILS_ROOT)
- backtrace.map { |line| line.sub RAILS_ROOT, '' }
- else
- backtrace
- end
- end
+ defined?(Rails) && Rails.respond_to?(:backtrace_cleaner) ?
+ Rails.backtrace_cleaner.clean(exception.backtrace) : exception.backtrace
end
end
end