Exception: Xshellz::ApiError

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

Overview

Any other non-success API response (4xx/5xx).

Carries the HTTP status and the parsed JSON body (or the raw text when the response was not JSON).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, status:, body: nil) ⇒ ApiError

Returns a new instance of ApiError.



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

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

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



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

def body
  @body
end

#statusObject (readonly)

Returns the value of attribute status.



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

def status
  @status
end