Exception: Floe::ExecutionError

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

Direct Known Subclasses

PathError, TimeoutError

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, floe_error = "States.Runtime") ⇒ ExecutionError

Returns a new instance of ExecutionError.



65
66
67
68
# File 'lib/floe.rb', line 65

def initialize(message, floe_error = "States.Runtime")
  super(message)
  @floe_error = floe_error
end

Instance Attribute Details

#floe_errorObject (readonly)

Returns the value of attribute floe_error.



63
64
65
# File 'lib/floe.rb', line 63

def floe_error
  @floe_error
end

Class Method Details

.from_output(output) ⇒ Object

Raises:

  • (ArgumentError)


57
58
59
60
61
# File 'lib/floe.rb', line 57

def self.from_output(output)
  raise ArgumentError unless output.kind_of?(Hash) && output.key?("Error")

  new(output["Cause"], output["Error"])
end

Instance Method Details

#to_outputObject



70
71
72
73
74
75
# File 'lib/floe.rb', line 70

def to_output
  {"Error" => floe_error}.tap do |output|
    # If there is no "Cause" then ::Exception will use the exception class name
    output["Cause"] = message if message != self.class.name.to_s
  end
end