Skip to content

Commit f7ba6c4

Browse files
authored
Merge pull request rails#53979 from byroot/ad-executor-unwrap-exceptions
Fix `ActionDispatch::Executor` to unwrap exceptions like other middlewares
2 parents a725732 + e91271a commit f7ba6c4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

actionpack/lib/action_dispatch/middleware/executor.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ def call(env)
2222

2323
returned = response << ::Rack::BodyProxy.new(response.pop) { state.complete! }
2424
rescue => error
25-
@executor.error_reporter.report(error, handled: false, source: "application.action_dispatch")
25+
request = ActionDispatch::Request.new env
26+
backtrace_cleaner = request.get_header("action_dispatch.backtrace_cleaner")
27+
wrapper = ExceptionWrapper.new(backtrace_cleaner, error)
28+
@executor.error_reporter.report(wrapper.unwrapped_exception, handled: false, source: "application.action_dispatch")
2629
raise
2730
ensure
2831
state.complete! unless returned

0 commit comments

Comments
 (0)