From e4a2583851446d36d16178c57271300bf8e42adc Mon Sep 17 00:00:00 2001 From: Lee Richmond Date: Tue, 17 Aug 2021 16:12:42 -0400 Subject: [PATCH] Fix status code 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 ae62623a..d9b87ab9 100644 --- a/lib/lograge/log_subscribers/base.rb +++ b/lib/lograge/log_subscribers/base.rb @@ -52,9 +52,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)