aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2019-07-16 14:33:47 +0100
committerRafael Mendonça França <rafaelmfranca@gmail.com>2019-07-16 14:33:47 +0100
commit650c0701507c68625dc9a867cd3bf60ad6c421f8 (patch)
tree6e2f4cf8b50770aa168e837192b18758c6171ab0 /actionpack
parent238d36715ede0952a227c8ec7b6e6e086c1f19d1 (diff)
downloadrails-650c0701507c68625dc9a867cd3bf60ad6c421f8.tar.gz
rails-650c0701507c68625dc9a867cd3bf60ad6c421f8.tar.bz2
rails-650c0701507c68625dc9a867cd3bf60ad6c421f8.zip
Reuse the exception class name in all places in the wrapper
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_dispatch/middleware/exception_wrapper.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb b/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb
index 4633d2cc16..e4a2a51c57 100644
--- a/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb
+++ b/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb
@@ -45,13 +45,14 @@ module ActionDispatch
def initialize(backtrace_cleaner, exception)
@backtrace_cleaner = backtrace_cleaner
@exception = exception
+ @exception_class_name = @exception.class.name
@wrapped_causes = wrapped_causes_for(exception, backtrace_cleaner)
expand_backtrace if exception.is_a?(SyntaxError) || exception.cause.is_a?(SyntaxError)
end
def unwrapped_exception
- if wrapper_exceptions.include?(exception.class.to_s)
+ if wrapper_exceptions.include?(@exception_class_name)
exception.cause
else
exception
@@ -59,7 +60,7 @@ module ActionDispatch
end
def rescue_template
- @@rescue_templates[@exception.class.name]
+ @@rescue_templates[@exception_class_name]
end
def status_code
@@ -68,7 +69,7 @@ module ActionDispatch
def exception_trace
trace = application_trace
- trace = framework_trace if trace.empty? && !silent_exceptions.include?(@exception.class.name)
+ trace = framework_trace if trace.empty? && !silent_exceptions.include?(@exception_class_name)
trace
end