Exception: Octoryn::APIError

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

Overview

A normalized non-success response from the Octoryn API.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status:, message:, code: nil, error_type: nil, request_id: nil, retry_after: nil) ⇒ APIError

Returns a new instance of APIError.



10
11
12
13
14
15
16
17
18
# File 'lib/octoryn/errors.rb', line 10

def initialize(status:, message:, code: nil, error_type: nil,
               request_id: nil, retry_after: nil)
  super(message)
  @status = status
  @code = code
  @error_type = error_type
  @request_id = request_id
  @retry_after = retry_after
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



8
9
10
# File 'lib/octoryn/errors.rb', line 8

def code
  @code
end

#error_typeObject (readonly)

Returns the value of attribute error_type.



8
9
10
# File 'lib/octoryn/errors.rb', line 8

def error_type
  @error_type
end

#request_idObject (readonly)

Returns the value of attribute request_id.



8
9
10
# File 'lib/octoryn/errors.rb', line 8

def request_id
  @request_id
end

#retry_afterObject (readonly)

Returns the value of attribute retry_after.



8
9
10
# File 'lib/octoryn/errors.rb', line 8

def retry_after
  @retry_after
end

#statusObject (readonly)

Returns the value of attribute status.



8
9
10
# File 'lib/octoryn/errors.rb', line 8

def status
  @status
end