Exception: XeroGateway::ApiException

Inherits:
StandardError
  • Object
show all
Defined in:
lib/xero_gateway/exceptions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, message, request_xml, response_xml) ⇒ ApiException

Returns a new instance of ApiException.



8
9
10
11
12
13
# File 'lib/xero_gateway/exceptions.rb', line 8

def initialize(type, message, request_xml, response_xml)
  @type     = type
  @message  = message
  @request_xml      = request_xml
  @response_xml      = response_xml
end

Instance Attribute Details

#request_xmlObject (readonly)

Returns the value of attribute request_xml.



15
16
17
# File 'lib/xero_gateway/exceptions.rb', line 15

def request_xml
  @request_xml
end

#response_xmlObject (readonly)

Returns the value of attribute response_xml.



15
16
17
# File 'lib/xero_gateway/exceptions.rb', line 15

def response_xml
  @response_xml
end

Instance Method Details

#messageObject



17
18
19
# File 'lib/xero_gateway/exceptions.rb', line 17

def message
  "#{@type}: #{@message} \n Generated by the following XML: \n #{@response_xml}"
end