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.
9 10 11 12 13 14 15 |
# File 'lib/twitch/api_error.rb', line 9 def initialize(status_code, body) @status_code = status_code @body = body msg = "The server returned error #{status_code}" super(msg) end |
Instance Attribute Details
#body ⇒ Object (readonly)
Body content of the response.
7 8 9 |
# File 'lib/twitch/api_error.rb', line 7 def body @body end |
#status_code ⇒ Object (readonly)
HTTP status code of the response.
5 6 7 |
# File 'lib/twitch/api_error.rb', line 5 def status_code @status_code end |