Skip to content

Commit

Permalink
Merge pull request #179 from umbrellio/update-log-error
Browse files Browse the repository at this point in the history
Fix log level for exceptions rescued by Rails
  • Loading branch information
reidmorrison authored Sep 29, 2024
2 parents f8f1084 + aaaf46a commit fb9bd70
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ class DebugExceptions
if (Rails::VERSION::MAJOR == 7 && Rails::VERSION::MINOR >= 1) || Rails::VERSION::MAJOR > 7
def log_error(_request, wrapper)
Rails.application.deprecators.silence do
ActionController::Base.logger.fatal(wrapper.exception)
level = wrapper.respond_to?(:rescue_response?) && wrapper.rescue_response? ? :debug : :fatal
ActionController::Base.logger.log(level, wrapper.exception)
end
end
else
def log_error(_request, wrapper)
ActiveSupport::Deprecation.silence do
ActionController::Base.logger.fatal(wrapper.exception)
level = wrapper.respond_to?(:rescue_response?) && wrapper.rescue_response? ? :debug : :fatal
ActionController::Base.logger.log(level, wrapper.exception)
end
end
end
Expand Down

0 comments on commit fb9bd70

Please sign in to comment.