instance method set_context

Ruby on Rails 8.0.4

Since v7.0.10

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

Signature

set_context(...)

Update the execution context that is accessible to error subscribers. Any context passed to #handle, #record, or #report will be merged with the context set here.

Rails.error.set_context(section: "checkout", user_id: @user.id)

Parameters

... req
Source
# File activesupport/lib/active_support/error_reporter.rb, line 201
    def set_context(...)
      ActiveSupport::ExecutionContext.set(...)
    end

Defined in activesupport/lib/active_support/error_reporter.rb line 201 · 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