class TaxCloud::Errors::SoapError

This error is raised when a SOAP call fails.

Attributes

fault[R]

Original SOAP failt.

Public Class Methods

new(exception) click to toggle source

Create the new error.

Parameters

e

SOAP response.

Calls superclass method
# File lib/tax_cloud/errors/soap_error.rb, line 13
def initialize(exception)
  @fault = exception
  exception.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

Private Instance Methods

parse_fault(fault_string) click to toggle source
# File lib/tax_cloud/errors/soap_error.rb, line 26
def parse_fault(fault_string)
  fault_string.lines.first.strip
end