-
-
Notifications
You must be signed in to change notification settings - Fork 128
Respect action_dispatch.log_rescued_responses #266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,9 +7,11 @@ class DebugExceptions | |
|
||
undef_method :log_error | ||
if (Rails::VERSION::MAJOR == 7 && Rails::VERSION::MINOR >= 1) || Rails::VERSION::MAJOR > 7 | ||
def log_error(_request, wrapper) | ||
def log_error(request, wrapper) | ||
Rails.application.deprecators.silence do | ||
level = wrapper.respond_to?(:rescue_response?) && wrapper.rescue_response? ? :debug : :fatal | ||
return if !log_rescued_responses?(request) && wrapper.rescue_response? | ||
|
||
level = request.get_header("action_dispatch.debug_exception_log_level") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Making this more aligned with the default behavior of |
||
ActionController::Base.logger.log(level, wrapper.exception) | ||
end | ||
end | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In #179, there was a concern about the
rescue_responses?
method not working in Rails 5 and 6, which led to thisrespond_to?
check being added. I don't believe it's necessary, however, because this is within a conditional that checks(Rails::VERSION::MAJOR == 7 && Rails::VERSION::MINOR >= 1) || Rails::VERSION::MAJOR > 7
, so we can feel confident that we are in Rails 7.1+. Given that, I took the liberty of removing therespond_to?
check