Exception: Tryiton::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/tryiton/client.rb

Overview

Raised for API-level errors and runtime (job) failures.

status      - HTTP status code, or nil for a runtime job failure.
error_name  - the API error name, e.g. "OutOfCredits" / "ProcessingError".

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, status: nil, error_name: nil) ⇒ Error

Returns a new instance of Error.



15
16
17
18
19
# File 'lib/tryiton/client.rb', line 15

def initialize(message, status: nil, error_name: nil)
  super(message)
  @status = status
  @error_name = error_name
end

Instance Attribute Details

#error_nameObject (readonly)

Returns the value of attribute error_name.



13
14
15
# File 'lib/tryiton/client.rb', line 13

def error_name
  @error_name
end

#statusObject (readonly)

Returns the value of attribute status.



13
14
15
# File 'lib/tryiton/client.rb', line 13

def status
  @status
end