Exception: SuggestGrid::ErrorResponse
- Inherits:
-
APIException
- Object
- StandardError
- APIException
- SuggestGrid::ErrorResponse
- Defined in:
- lib/suggestgrid/exceptions/error_response.rb
Overview
Error response.
Instance Attribute Summary collapse
-
#error_description ⇒ String
Description of the response.
-
#error_text ⇒ String
Message of the response.
-
#error_uri ⇒ String
The URI of the error for more details.
Attributes inherited from APIException
Instance Method Summary collapse
-
#initialize(reason, context) ⇒ ErrorResponse
constructor
The constructor.
-
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash.
Constructor Details
#initialize(reason, context) ⇒ ErrorResponse
The constructor.
22 23 24 25 26 |
# File 'lib/suggestgrid/exceptions/error_response.rb', line 22 def initialize(reason, context) super(reason, context) hash = APIHelper.json_deserialize(@context.response.raw_body) unbox(hash) end |
Instance Attribute Details
#error_description ⇒ String
Description of the response.
13 14 15 |
# File 'lib/suggestgrid/exceptions/error_response.rb', line 13 def error_description @error_description end |
#error_text ⇒ String
Message of the response.
9 10 11 |
# File 'lib/suggestgrid/exceptions/error_response.rb', line 9 def error_text @error_text end |
#error_uri ⇒ String
The URI of the error for more details.
17 18 19 |
# File 'lib/suggestgrid/exceptions/error_response.rb', line 17 def error_uri @error_uri end |
Instance Method Details
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash. response body.
31 32 33 34 35 |
# File 'lib/suggestgrid/exceptions/error_response.rb', line 31 def unbox(hash) @error_text = hash['error_text'] @error_description = hash['error_description'] @error_uri = hash['error_uri'] end |