From 238d36715ede0952a227c8ec7b6e6e086c1f19d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Tue, 16 Jul 2019 14:28:59 +0100 Subject: Make the selent exceptions configurable on the exception wrapper --- actionpack/lib/action_dispatch/middleware/exception_wrapper.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'actionpack') diff --git a/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb b/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb index c3bf91c232..4633d2cc16 100644 --- a/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb +++ b/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb @@ -36,6 +36,10 @@ module ActionDispatch "ActionView::Template::Error" ] + cattr_accessor :silent_exceptions, default: [ + "ActionController::RoutingError" + ] + attr_reader :backtrace_cleaner, :exception, :wrapped_causes, :line_number, :file def initialize(backtrace_cleaner, exception) @@ -64,7 +68,7 @@ module ActionDispatch def exception_trace trace = application_trace - trace = framework_trace if trace.empty? && !exception.is_a?(ActionController::RoutingError) + trace = framework_trace if trace.empty? && !silent_exceptions.include?(@exception.class.name) trace end -- cgit v1.2.3