Exception: Shippo::Exceptions::APIServerError

Inherits:
APIError
  • Object
show all
Defined in:
lib/shippo/exceptions/api_server_error.rb

Overview

The APIServerError happens when the server returns a parseable JSON response, but when such response indicates a failed operation due to either validation or other business, data or logic issues.

The error adds the HTTP response message member, which would typically be “400 Bad Request”

Instance Attribute Summary

Attributes inherited from APIError

#http_response_message, #request, #response

Attributes inherited from Error

#message

Instance Method Summary collapse

Methods inherited from APIError

#server_url

Methods inherited from Error

#to_s

Constructor Details

#initialize(message = nil, request = nil, response = nil, http_response_message = nil) ⇒ APIServerError

Returns a new instance of APIServerError.



15
16
17
18
# File 'lib/shippo/exceptions/api_server_error.rb', line 15

def initialize(message = nil, request = nil, response = nil, http_response_message = nil)
  super(message, request, response)
  self.http_response_message = http_response_message
end

Instance Method Details

#to_s_membersObject



20
21
22
# File 'lib/shippo/exceptions/api_server_error.rb', line 20

def to_s_members
  %i(http_response_message) + super
end