Method: ActiveSupport::ErrorReporter#disable
- Defined in:
- activesupport/lib/active_support/error_reporter.rb
#disable(subscriber) ⇒ Object
Prevent a subscriber from being notified of errors for the duration of the block. You may pass in the subscriber itself, or its class.
This can be helpful for error reporting service integrations, when they wish to handle any errors higher in the stack.
185 186 187 188 189 190 191 192 193 |
# File 'activesupport/lib/active_support/error_reporter.rb', line 185 def disable(subscriber) disabled_subscribers = (ActiveSupport::IsolatedExecutionState[self] ||= []) disabled_subscribers << subscriber begin yield ensure disabled_subscribers.delete(subscriber) end end |