diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2019-07-16 14:16:28 +0100 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2019-07-16 14:16:28 +0100 |
commit | a115a4cc796e55f2a86e36e92780fa74cd1c4c33 (patch) | |
tree | 0f9c95d6555de86760cadd28a23c75d39d1bccf9 /actionpack/lib/action_dispatch | |
parent | 5a9301ce47f1117c8d457cad2b850f932bf7f518 (diff) | |
parent | c8f4c53d55762010496cf801cf1ec726e35d75df (diff) | |
download | rails-a115a4cc796e55f2a86e36e92780fa74cd1c4c33.tar.gz rails-a115a4cc796e55f2a86e36e92780fa74cd1c4c33.tar.bz2 rails-a115a4cc796e55f2a86e36e92780fa74cd1c4c33.zip |
Merge pull request #31634 from afcapel/reduce-routing-error-log-noise
Reduce log noise handling ActionController::RoutingErrors
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/debug_exceptions.rb | 4 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/exception_wrapper.rb | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb b/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb index f8937a2faf..e546d1c11f 100644 --- a/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb +++ b/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb @@ -137,9 +137,7 @@ module ActionDispatch return unless logger exception = wrapper.exception - - trace = wrapper.application_trace - trace = wrapper.framework_trace if trace.empty? + trace = wrapper.exception_trace ActiveSupport::Deprecation.silence do message = [] diff --git a/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb b/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb index 2da0ef9600..c3bf91c232 100644 --- a/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb +++ b/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb @@ -62,6 +62,12 @@ module ActionDispatch self.class.status_code_for_exception(unwrapped_exception.class.name) end + def exception_trace + trace = application_trace + trace = framework_trace if trace.empty? && !exception.is_a?(ActionController::RoutingError) + trace + end + def application_trace clean_backtrace(:silent) end |