Skip to content

Commit 8f76cca

Browse files
authored
Ensure we guard against all exceptions, not just StandardError
1 parent f4a7942 commit 8f76cca

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

activesupport/lib/active_support/notifications/fanout.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def iterate_guarding_exceptions(listeners)
8989

9090
listeners.each do |s|
9191
yield s
92-
rescue => e
92+
rescue Exception => e
9393
exceptions ||= []
9494
exceptions << e
9595
end

activesupport/test/notifications/evented_notification_test.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
module ActiveSupport
66
module Notifications
77
class EventedTest < ActiveSupport::TestCase
8-
class BadListenerException < RuntimeError; end
8+
# we expect all exception types to be handled, so test with the most basic type
9+
class BadListenerException < Exception; end
910

1011
class Listener
1112
attr_reader :events

0 commit comments

Comments
 (0)