mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix instrumenting internal server errors
In case of an exception we never reach setting the status in the payload so it is unset afterward. Let's catch the exception and set status based on the exception class name. Then re-raise it. This is basically the equivalent of what happens in ActionController::LogSubscriber.process_action
This commit is contained in:
parent
738ca3595f
commit
1966806cd0
1 changed files with 3 additions and 0 deletions
|
@ -35,6 +35,9 @@ module ActionController
|
|||
payload[:response] = response
|
||||
payload[:status] = response.status
|
||||
result
|
||||
rescue => error
|
||||
payload[:status] = ActionDispatch::ExceptionWrapper.status_code_for_exception(error.class.name)
|
||||
raise
|
||||
ensure
|
||||
append_info_to_payload(payload)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue