From 93b98913134d2e8a24de3215573b14cb43f5ef27 Mon Sep 17 00:00:00 2001 From: Lee Richmond Date: Tue, 11 Jan 2022 10:28:54 -0500 Subject: [PATCH] Fix status code (#334) 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! --- lib/lograge/log_subscribers/base.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/lograge/log_subscribers/base.rb b/lib/lograge/log_subscribers/base.rb index 0a7bbff0..adbc322a 100644 --- a/lib/lograge/log_subscribers/base.rb +++ b/lib/lograge/log_subscribers/base.rb @@ -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)