Exception: InstagramApi::Error
- Inherits:
-
StandardError
- Object
- StandardError
- InstagramApi::Error
- Defined in:
- lib/instagram_api/exceptions.rb
Direct Known Subclasses
BadGateway, BadRequest, GatewayTimeout, InternalServerError, InvalidSignature, NotFound, RateLimitExceeded, ServiceUnavailable, TooManyRequests
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(response) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(response) ⇒ Error
Returns a new instance of Error.
6 7 8 9 10 11 12 |
# File 'lib/instagram_api/exceptions.rb', line 6 def initialize(response) body = JSON.parse(response.body) @code = "#{response[:status]}" @type = body['meta']['error_type'] @message = body['meta']['error_message'] end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
4 5 6 |
# File 'lib/instagram_api/exceptions.rb', line 4 def code @code end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
4 5 6 |
# File 'lib/instagram_api/exceptions.rb', line 4 def @message end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
4 5 6 |
# File 'lib/instagram_api/exceptions.rb', line 4 def type @type end |