Module: SpreeAvataxOfficial::HttpHelper

Included in:
Avatax::RequestDecorator
Defined in:
app/helpers/spree_avatax_official/http_helper.rb

Constant Summary collapse

CONNECTION_ERRORS =
[
  Faraday::TimeoutError, Faraday::ConnectionFailed, Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, Errno::ECONNREFUSED,
  EOFError, Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError
].freeze

Instance Method Summary collapse

Instance Method Details

#mock_error_response(error) ⇒ Object



8
9
10
11
12
13
14
15
# File 'app/helpers/spree_avatax_official/http_helper.rb', line 8

def mock_error_response(error)
  {
    'error' => {
      'code'    => 'ConnectionError',
      'message' => "#{error.class} - #{error.message}"
    }
  }
end