Exception: Tvdb2::RequestError
- Inherits:
-
StandardError
- Object
- StandardError
- Tvdb2::RequestError
- Defined in:
- lib/tvdb2/request_error.rb
Overview
Exception raised when an http request to an endpoint return a status code different from 200 or 404.
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(response) ⇒ RequestError
constructor
A new instance of RequestError.
Constructor Details
#initialize(response) ⇒ RequestError
Returns a new instance of RequestError
10 11 12 13 14 15 |
# File 'lib/tvdb2/request_error.rb', line 10 def initialize(response) super(response['Error'] || response.) @response = response @code = response.code @error = response['Error'] end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code
7 8 9 |
# File 'lib/tvdb2/request_error.rb', line 7 def code @code end |
#error ⇒ Object (readonly)
Returns the value of attribute error
7 8 9 |
# File 'lib/tvdb2/request_error.rb', line 7 def error @error end |
#response ⇒ Object (readonly)
Returns the value of attribute response
7 8 9 |
# File 'lib/tvdb2/request_error.rb', line 7 def response @response end |