Exception: ActiveInteractor::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/active_interactor/errors.rb

Overview

Raised when an interactor fails

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(result, message = nil) ⇒ ActiveInteractor::Error

Create a new instance of ActiveInteractor::Error

Parameters:



20
21
22
23
# File 'lib/active_interactor/errors.rb', line 20

def initialize(result, message = nil)
  @result = result
  super(message)
end

Instance Attribute Details

#resultActiveInteractor::Result (readonly)

Returns An instance of Result for the interactor that failed.

Returns:



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/active_interactor/errors.rb', line 9

class Error < StandardError
  attr_reader :result

  # Create a new instance of {ActiveInteractor::Error}
  #
  # @param result [ActiveInteractor::Result] An instance of {ActiveInteractor::Result} for the
  #   {ActiveInteractor::Interactor::Base interactor} that failed
  # @param message [String] The error message
  #
  # @private
  # @return [ActiveInteractor::Error]
  def initialize(result, message = nil)
    @result = result
    super(message)
  end
end