Exception: Shojiku::UnwrapError

Inherits:
Error
  • Object
show all
Defined in:
lib/shojiku/errors.rb

Overview

Unwrapping a Result that failed.

artifact! / report! are the opt-in bridge to exception-style control flow. Calling one on a failed result is programmer misuse — the ruling is explicit and frozen for every Shojiku SDK, because an accessor that raises is the one place this API could drift back into exceptions by accident. The failure travels on the exception, so nothing is lost by taking the short road.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(failure) ⇒ UnwrapError

Returns a new instance of UnwrapError.



35
36
37
38
# File 'lib/shojiku/errors.rb', line 35

def initialize(failure)
  @failure = failure
  super(failure.to_s)
end

Instance Attribute Details

#failureObject (readonly)

Returns the value of attribute failure.



33
34
35
# File 'lib/shojiku/errors.rb', line 33

def failure
  @failure
end