Exception: Twitch::APIError
- Inherits:
-
StandardError
- Object
- StandardError
- Twitch::APIError
- Defined in:
- lib/twitch/api_error.rb
Overview
An error returned by the API.
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Body content of the response.
-
#status_code ⇒ Object
readonly
HTTP status code of the response.
Instance Method Summary collapse
-
#initialize(status_code, body) ⇒ APIError
constructor
A new instance of APIError.
Constructor Details
#initialize(status_code, body) ⇒ APIError
Returns a new instance of APIError.
11 12 13 14 15 16 |
# File 'lib/twitch/api_error.rb', line 11 def initialize(status_code, body) @status_code = status_code @body = body super self.body['message'] end |
Instance Attribute Details
#body ⇒ Object (readonly)
Body content of the response.
9 10 11 |
# File 'lib/twitch/api_error.rb', line 9 def body @body end |
#status_code ⇒ Object (readonly)
HTTP status code of the response.
7 8 9 |
# File 'lib/twitch/api_error.rb', line 7 def status_code @status_code end |