1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Reuse the exception class name in all places in the wrapper

This commit is contained in:
Rafael Mendonça França 2019-07-16 14:33:47 +01:00
parent 238d36715e
commit 650c070150
No known key found for this signature in database
GPG key ID: FC23B6D0F1EEE948

View file

@ -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