diff options
author | Charlie Somerville <charlie@charliesomerville.com> | 2013-11-13 19:34:15 -0800 |
---|---|---|
committer | Charlie Somerville <charlie@charliesomerville.com> | 2013-11-13 19:34:15 -0800 |
commit | 425f4829bd7adddedf4cfcf57173f03ee3343213 (patch) | |
tree | 4273c3766cc445210cbf7ed997fc9985eb54a815 /activesupport | |
parent | f5ecb133335dbfcb2322e5ce91158cf91f730aea (diff) | |
download | rails-425f4829bd7adddedf4cfcf57173f03ee3343213.tar.gz rails-425f4829bd7adddedf4cfcf57173f03ee3343213.tar.bz2 rails-425f4829bd7adddedf4cfcf57173f03ee3343213.zip |
Use rescue with a splat rather and catching all and filtering
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/core_ext/kernel/reporting.rb | 3 |
1 files changed, 1 insertions, 2 deletions
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: |