31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
# File 'actionpack/lib/action_dispatch/middleware/show_exceptions.rb', line 31
def call(env)
@app.call(env)
rescue Exception => exception
request = ActionDispatch::Request.new env
backtrace_cleaner = request.("action_dispatch.backtrace_cleaner")
wrapper = ExceptionWrapper.new(backtrace_cleaner, exception)
request. "action_dispatch.exception", wrapper.unwrapped_exception
request. "action_dispatch.report_exception", !wrapper.rescue_response?
if wrapper.show?(request)
render_exception(request.dup, wrapper)
else
raise exception
end
end
|