Exception: ServiceActor::Failure

Inherits:
Error
  • Object
show all
Defined in:
lib/service_actor/failure.rb

Overview

Default error raised when using ‘fail!` inside an actor.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(result) ⇒ Failure

Returns a new instance of Failure.



5
6
7
8
9
10
11
# File 'lib/service_actor/failure.rb', line 5

def initialize(result)
  @result = result

  error = result.respond_to?(:error) ? result.error : nil

  super(error)
end

Instance Attribute Details

#resultObject (readonly)

Returns the value of attribute result.



13
14
15
# File 'lib/service_actor/failure.rb', line 13

def result
  @result
end