Skip to content
Browse files

Use rescue with a splat rather and catching all and filtering

  • Loading branch information...
1 parent f5ecb13 commit 425f4829bd7adddedf4cfcf57173f03ee3343213 @charliesome charliesome committed
Showing with 1 addition and 2 deletions.
  1. +1 −2 activesupport/lib/active_support/core_ext/kernel/reporting.rb
View
3 activesupport/lib/active_support/core_ext/kernel/reporting.rb
@@ -60,8 +60,7 @@ def silence_stream(stream)
# 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:

0 comments on commit 425f482

Please sign in to comment.
Something went wrong with that request. Please try again.