mirror of https://github.com/rails/rails
Revert "Add default exceptions affected by suppress (#25099)"
This reverts commit 28492204ee
.
Reason: `suppress` without an argument doesn't actually tell what is
supressing. Also, it can be confused with ActiveRecord::Base#suppress.
This commit is contained in:
parent
28492204ee
commit
661ed303f4
|
@ -37,7 +37,6 @@ module Kernel
|
|||
#
|
||||
# puts 'This code gets executed and nothing related to ZeroDivisionError was seen'
|
||||
def suppress(*exception_classes)
|
||||
exception_classes = StandardError if exception_classes.empty?
|
||||
yield
|
||||
rescue *exception_classes
|
||||
end
|
||||
|
|
|
@ -42,15 +42,6 @@ class KernelSuppressTest < ActiveSupport::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
def test_suppress_with_defaults
|
||||
suppress { raise RuntimeError }
|
||||
suppress { raise ArgumentError }
|
||||
|
||||
assert_raise(LoadError) do
|
||||
suppress { raise LoadError }
|
||||
end
|
||||
end
|
||||
|
||||
def test_suppression
|
||||
suppress(ArgumentError) { raise ArgumentError }
|
||||
suppress(LoadError) { raise LoadError }
|
||||
|
|
Loading…
Reference in New Issue