Exception: Polar::Error::APIError
- Inherits:
-
StandardError
- Object
- StandardError
- Polar::Error::APIError
- Defined in:
- lib/polar/error/api_error.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#message ⇒ Object
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(error_response) ⇒ APIError
constructor
A new instance of APIError.
- #to_s ⇒ Object
Constructor Details
#initialize(error_response) ⇒ APIError
Returns a new instance of APIError.
7 8 9 |
# File 'lib/polar/error/api_error.rb', line 7 def initialize(error_response) @code, @message = error_response["error_code"], error_response["error_msg"] end |
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
5 6 7 |
# File 'lib/polar/error/api_error.rb', line 5 def code @code end |
#message ⇒ Object
Returns the value of attribute message.
5 6 7 |
# File 'lib/polar/error/api_error.rb', line 5 def @message end |
Instance Method Details
#to_s ⇒ Object
11 12 13 |
# File 'lib/polar/error/api_error.rb', line 11 def to_s "The Renren API has returned an Error:(#{@code} - #{@message})" end |