Exception: TaxCloud::Errors::SoapError

Inherits:
TaxCloudError show all
Defined in:
lib/tax_cloud/errors/soap_error.rb

Overview

This error is raised when a SOAP call fails.

Instance Attribute Summary collapse

Attributes inherited from TaxCloudError

#problem, #resolution, #summary

Instance Method Summary collapse

Methods inherited from TaxCloudError

#compose_message

Constructor Details

#initialize(e) ⇒ SoapError

Create the new error.

Parameters

e

SOAP response.



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/tax_cloud/errors/soap_error.rb', line 12

def initialize(e)
  @fault = e
  e.to_hash.tap do |fault|
    fault_code = fault[:fault][:faultcode]
    fault_string = parse_fault(fault[:fault][:faultstring])
    super(compose_message('soap_error',
                          message: fault_string,
                          code: fault_code
    ))
  end
end

Instance Attribute Details

#faultObject (readonly)

Original SOAP failt.



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

def fault
  @fault
end