aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorGuillermo Iguaran <guilleiguaran@gmail.com>2013-11-13 19:37:04 -0800
committerGuillermo Iguaran <guilleiguaran@gmail.com>2013-11-13 19:37:04 -0800
commit416a9c73d3ddacd5c254aacd3a8b055b4c28092d (patch)
tree1bd48646c6646d083c3163332d52e68068a5c863 /activesupport
parent54dde362cc8b733ef5e8d18ca1fd2f22f2d94785 (diff)
parent425f4829bd7adddedf4cfcf57173f03ee3343213 (diff)
downloadrails-416a9c73d3ddacd5c254aacd3a8b055b4c28092d.tar.gz
rails-416a9c73d3ddacd5c254aacd3a8b055b4c28092d.tar.bz2
rails-416a9c73d3ddacd5c254aacd3a8b055b4c28092d.zip
Merge pull request #12882 from charliesome/use-rescue-splat-in-suppress
Use rescue with a splat rather and catching all exceptions and manually filtering in Kernel#suppress
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/core_ext/kernel/reporting.rb3
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 36ab836457..be34eb505b 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: