Exception: Shippo::Exceptions::APIError
- Defined in:
- lib/shippo/exceptions/api_error.rb
Direct Known Subclasses
API::Category::DuplicateValueError, APIServerError, InvalidCategoryValueError, InvalidJsonError, UnsuccessfulResponseError
Instance Attribute Summary collapse
-
#http_response_message ⇒ Object
Returns the value of attribute http_response_message.
-
#request ⇒ Object
Returns the value of attribute request.
-
#response ⇒ Object
Returns the value of attribute response.
Attributes inherited from Error
Instance Method Summary collapse
-
#initialize(message = nil, request = nil, response = nil) ⇒ APIError
constructor
A new instance of APIError.
- #server_url ⇒ Object
- #to_s_members ⇒ Object
Methods inherited from Error
Constructor Details
#initialize(message = nil, request = nil, response = nil) ⇒ APIError
Returns a new instance of APIError.
9 10 11 12 13 14 15 |
# File 'lib/shippo/exceptions/api_error.rb', line 9 def initialize( = nil, request = nil, response = nil) super() self.request = request self.response = response end |
Instance Attribute Details
#http_response_message ⇒ Object
Returns the value of attribute http_response_message.
4 5 6 |
# File 'lib/shippo/exceptions/api_error.rb', line 4 def @http_response_message end |
#request ⇒ Object
Returns the value of attribute request.
4 5 6 |
# File 'lib/shippo/exceptions/api_error.rb', line 4 def request @request end |
#response ⇒ Object
Returns the value of attribute response.
4 5 6 |
# File 'lib/shippo/exceptions/api_error.rb', line 4 def response @response end |
Instance Method Details
#server_url ⇒ Object
21 22 23 |
# File 'lib/shippo/exceptions/api_error.rb', line 21 def server_url @server_url ||= (request ? request.url : '') end |
#to_s_members ⇒ Object
17 18 19 |
# File 'lib/shippo/exceptions/api_error.rb', line 17 def to_s_members super + %i(server_url response) end |