Exception: XeroKiwi::APIError

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status, body, message = nil) ⇒ APIError

Returns a new instance of APIError.



9
10
11
12
13
# File 'lib/xero_kiwi/errors.rb', line 9

def initialize(status, body, message = nil)
  @status = status
  @body   = body
  super(message || "Xero API responded with #{status}: #{body.inspect}")
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



7
8
9
# File 'lib/xero_kiwi/errors.rb', line 7

def body
  @body
end

#statusObject (readonly)

Returns the value of attribute status.



7
8
9
# File 'lib/xero_kiwi/errors.rb', line 7

def status
  @status
end