Exception: Amply::Exceptions::APIException
- Inherits:
-
StandardError
- Object
- StandardError
- Amply::Exceptions::APIException
- Defined in:
- lib/amply/exceptions/api_exception.rb
Instance Attribute Summary collapse
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(response) ⇒ APIException
constructor
A new instance of APIException.
- #message ⇒ Object
Constructor Details
#initialize(response) ⇒ APIException
6 7 8 9 10 11 |
# File 'lib/amply/exceptions/api_exception.rb', line 6 def initialize(response) @status = response.code.to_i @text = response. super end |
Instance Attribute Details
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/amply/exceptions/api_exception.rb', line 4 def status @status end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
4 5 6 |
# File 'lib/amply/exceptions/api_exception.rb', line 4 def text @text end |
Instance Method Details
#message ⇒ Object
13 14 15 |
# File 'lib/amply/exceptions/api_exception.rb', line 13 def 'An error occurred while making an API request' end |