Ensure we guard against all exceptions, not just StandardError

This commit is contained in:
Theo Julienne 2021-10-04 23:07:50 +00:00 committed by GitHub
parent f4a7942de1
commit 8f76cca3d9
2 changed files with 3 additions and 2 deletions

View File

@ -89,7 +89,7 @@ module ActiveSupport
listeners.each do |s|
yield s
rescue => e
rescue Exception => e
exceptions ||= []
exceptions << e
end

View File

@ -5,7 +5,8 @@ require_relative "../abstract_unit"
module ActiveSupport
module Notifications
class EventedTest < ActiveSupport::TestCase
class BadListenerException < RuntimeError; end
# we expect all exception types to be handled, so test with the most basic type
class BadListenerException < Exception; end
class Listener
attr_reader :events