Reuse the exception class name in all places in the wrapper

上级 238d3671
......@@ -45,13 +45,14 @@ class ExceptionWrapper
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 @@ def unwrapped_exception
end
def rescue_template
@@rescue_templates[@exception.class.name]
@@rescue_templates[@exception_class_name]
end
def status_code
......@@ -68,7 +69,7 @@ def status_code
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册