instance method disable

Ruby on Rails 7.1.6

Since v7.1.6

Available in: v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

disable(subscriber)

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.

Parameters

subscriber req
Source
# File activesupport/lib/active_support/error_reporter.rb, line 147
    def disable(subscriber)
      disabled_subscribers = (ActiveSupport::IsolatedExecutionState[self] ||= [])
      disabled_subscribers << subscriber
      begin
        yield
      ensure
        disabled_subscribers.delete(subscriber)
      end
    end

Defined in activesupport/lib/active_support/error_reporter.rb line 147 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveSupport::ErrorReporter

Type at least 2 characters to search.

↑↓ navigate · open · esc close