Skip to content

Commit

Permalink
Fix status code (roidrage#334)
Browse files Browse the repository at this point in the history
The code here is getting the status code through an internal interface,
rather than [what Rails itself does](https://github.com/rails/rails/search?q=status_code_for_exception).
Let's use the public interface to ensure we get the right status code!
  • Loading branch information
richmolj authored and olleolleolle committed Jan 11, 2022
1 parent 2a11054 commit 93b9891
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/lograge/log_subscribers/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,8 @@ def default_status
0
end

def get_error_status_code(exception)
status = ActionDispatch::ExceptionWrapper.rescue_responses[exception]
Rack::Utils.status_code(status)
def get_error_status_code(exception_class_name)
ActionDispatch::ExceptionWrapper.status_code_for_exception(exception_class_name)
end

def custom_options(event)
Expand Down

0 comments on commit 93b9891

Please sign in to comment.