Exception: Xero::Errors::BadRequest

Inherits:
StandardError
  • Object
show all
Defined in:
lib/xero/errors/bad_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_xml, response_xml) ⇒ BadRequest

Returns a new instance of BadRequest.



7
8
9
10
11
12
13
14
15
16
# File 'lib/xero/errors/bad_request.rb', line 7

def initialize(request_xml, response_xml)
  @request_xml = request_xml
  @response_xml = response_xml
  Hash.from_xml(response_xml).tap do |data|
    @type = data['ApiException']['Type']
    @message = data['ApiException']['Message']
    @error_number = data['ApiException']['ErrorNumber']
  end
  self
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



5
6
7
# File 'lib/xero/errors/bad_request.rb', line 5

def message
  @message
end

#request_xmlObject (readonly)

Returns the value of attribute request_xml.



5
6
7
# File 'lib/xero/errors/bad_request.rb', line 5

def request_xml
  @request_xml
end

#response_xmlObject (readonly)

Returns the value of attribute response_xml.



5
6
7
# File 'lib/xero/errors/bad_request.rb', line 5

def response_xml
  @response_xml
end

#typeObject (readonly)

Returns the value of attribute type.



5
6
7
# File 'lib/xero/errors/bad_request.rb', line 5

def type
  @type
end