Exception: MessageMediaLookups::APIException
- Inherits:
-
StandardError
- Object
- StandardError
- MessageMediaLookups::APIException
- Defined in:
- lib/message_media_lookups/exceptions/api_exception.rb
Overview
Class for exceptions when there is a network error, status code error, etc.
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.
10 11 12 13 14 |
# File 'lib/message_media_lookups/exceptions/api_exception.rb', line 10 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.
5 6 7 |
# File 'lib/message_media_lookups/exceptions/api_exception.rb', line 5 def context @context end |
#response_code ⇒ Object (readonly)
Returns the value of attribute response_code.
5 6 7 |
# File 'lib/message_media_lookups/exceptions/api_exception.rb', line 5 def response_code @response_code end |