Exception: SuggestGrid::APIException
- Inherits:
-
StandardError
- Object
- StandardError
- SuggestGrid::APIException
- Defined in:
- lib/suggestgrid/exceptions/api_exception.rb
Overview
Class for exceptions when there is a network error, status code error, etc.
Direct Known Subclasses
DetailedErrorResponse, ErrorResponse, LimitExceededErrorResponse
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#response_code ⇒ Object
readonly
Returns the value of attribute response_code.
Instance Method Summary collapse
-
#initialize(reason, context) ⇒ APIException
constructor
The constructor.
Constructor Details
#initialize(reason, context) ⇒ APIException
The constructor.
12 13 14 15 16 |
# File 'lib/suggestgrid/exceptions/api_exception.rb', line 12 def initialize(reason, context) super(reason) @context = context @response_code = context.response.status_code end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
7 8 9 |
# File 'lib/suggestgrid/exceptions/api_exception.rb', line 7 def context @context end |
#response_code ⇒ Object (readonly)
Returns the value of attribute response_code.
7 8 9 |
# File 'lib/suggestgrid/exceptions/api_exception.rb', line 7 def response_code @response_code end |