Exception: RoyalMailApi::SoapError

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

Constant Summary collapse

SOAP_FAULT_DESCRIPTIONS =
{
  "env:VersionMismatch" => "Found an invalid namespace for the SOAP Envelope element.",
  "env:MustUnderstand"  => "An immediate child element of the Header element, with the mustUnderstand attribute set to '1', was not understood.",
  "env:Client"          => "The message was incorrectly formed or contained incorrect information.",
  "env:Server"          => "There was a problem with the server, so the message could not proceed."
}

Instance Attribute Summary collapse

Attributes inherited from Error

#code, #description

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ SoapError

Returns a new instance of SoapError.



33
34
35
36
37
38
39
40
41
42
43
# File 'lib/royal_mail_api/error.rb', line 33

def initialize(args)
  super

  @xml = args[:xml]
  @code = args[:error_code]
  @parser = RoyalMailApi::XmlParser.new

  set_faultcode
  set_faultstring
  set_description
end

Instance Attribute Details

#faultcodeObject

Returns the value of attribute faultcode.



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

def faultcode
  @faultcode
end

#faultstringObject

Returns the value of attribute faultstring.



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

def faultstring
  @faultstring
end

#parserObject

Returns the value of attribute parser.



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

def parser
  @parser
end

#xmlObject

Returns the value of attribute xml.



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

def xml
  @xml
end