Exception: ActiveInteractor::Error::ContextFailure
- Inherits:
-
StandardError
- Object
- StandardError
- ActiveInteractor::Error::ContextFailure
- Defined in:
- lib/active_interactor/error.rb
Overview
Raised when an interactor context fails.
Instance Attribute Summary collapse
-
#context ⇒ Context::Base
readonly
An instance of context used for debugging.
Instance Method Summary collapse
-
#initialize(context = nil) ⇒ ContextFailure
constructor
Initialize a new instance of ContextFailure.
Constructor Details
#initialize(context = nil) ⇒ ContextFailure
Initialize a new instance of ActiveInteractor::Error::ContextFailure
22 23 24 25 26 |
# File 'lib/active_interactor/error.rb', line 22 def initialize(context = nil) @context = context context_class_name = context&.class&.name || 'Context' super("#{context_class_name} failed!") end |
Instance Attribute Details
#context ⇒ Context::Base (readonly)
An instance of context used for debugging.
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/active_interactor/error.rb', line 15 class ContextFailure < StandardError attr_reader :context # Initialize a new instance of {ContextFailure} # # @param context [Class, nil] an instance of {Context::Base context} # @return [ContextFailure] a new instance of {ContextFailure} def initialize(context = nil) @context = context context_class_name = context&.class&.name || 'Context' super("#{context_class_name} failed!") end end |