Exception: Twitch::APIError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/twitch/api_error.rb

Overview

An error returned by the API.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#bodyObject (readonly)

Body content of the response.



9
10
11
# File 'lib/twitch/api_error.rb', line 9

def body
  @body
end

#status_codeObject (readonly)

HTTP status code of the response.



7
8
9
# File 'lib/twitch/api_error.rb', line 7

def status_code
  @status_code
end