From 425f4829bd7adddedf4cfcf57173f03ee3343213 Mon Sep 17 00:00:00 2001 From: Charlie Somerville Date: Wed, 13 Nov 2013 19:34:15 -0800 Subject: Use rescue with a splat rather and catching all and filtering --- activesupport/lib/active_support/core_ext/kernel/reporting.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'activesupport/lib/active_support') diff --git a/activesupport/lib/active_support/core_ext/kernel/reporting.rb b/activesupport/lib/active_support/core_ext/kernel/reporting.rb index 79d3303b41..208575800e 100644 --- a/activesupport/lib/active_support/core_ext/kernel/reporting.rb +++ b/activesupport/lib/active_support/core_ext/kernel/reporting.rb @@ -60,8 +60,7 @@ module Kernel # puts 'This code gets executed and nothing related to ZeroDivisionError was seen' def suppress(*exception_classes) yield - rescue Exception => e - raise unless exception_classes.any? { |cls| e.kind_of?(cls) } + rescue *exception_classes => e end # Captures the given stream and returns it: -- cgit v1.2.3