Exception: SOAP::MultiService::ApiError

Inherits:
Error
  • Object
show all
Defined in:
lib/soapex/error.rb

Overview

Raised if a call returns with a SOAP error

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fault) ⇒ ApiError

Returns a new instance of ApiError.



24
25
26
27
28
29
30
31
32
33
# File 'lib/soapex/error.rb', line 24

def initialize(fault)
  @soap_faultcode = getOrNil(fault, 'faultcode')
  @soap_faultstring = getOrNil(fault, 'faultstring')
  @code = getOrNil(fault.detail, 'code')
  @internal = getOrNil(fault.detail,'internal')
  @message = @soap_faultstring #getOrNil(fault.detail,'message')
  @message = getOrNil(fault.detail,'message')
  @trigger = getOrNil(fault.detail,'trigger')
  @violations = getOrNil(fault.detail,'violations')
end

Instance Attribute Details

#codeObject

Returns the value of attribute code.



18
19
20
# File 'lib/soapex/error.rb', line 18

def code
  @code
end

#internalObject

Returns the value of attribute internal.



19
20
21
# File 'lib/soapex/error.rb', line 19

def internal
  @internal
end

#messageObject

Returns the value of attribute message.



20
21
22
# File 'lib/soapex/error.rb', line 20

def message
  @message
end

#soap_faultcodeObject

Returns the value of attribute soap_faultcode.



16
17
18
# File 'lib/soapex/error.rb', line 16

def soap_faultcode
  @soap_faultcode
end

#soap_faultstringObject

Returns the value of attribute soap_faultstring.



17
18
19
# File 'lib/soapex/error.rb', line 17

def soap_faultstring
  @soap_faultstring
end

#triggerObject

Returns the value of attribute trigger.



21
22
23
# File 'lib/soapex/error.rb', line 21

def trigger
  @trigger
end

#violationsObject

Returns the value of attribute violations.



22
23
24
# File 'lib/soapex/error.rb', line 22

def violations
  @violations
end

Instance Method Details

#inspectObject



35
36
37
# File 'lib/soapex/error.rb', line 35

def inspect
  "#<SOAP::MultiService::ApiError: \"#{@code || @soap_faultstring || @message}\">"
end

#to_sObject



39
40
41
# File 'lib/soapex/error.rb', line 39

def to_s
  inspect
end