Exception: Rsplunk::APIError
- Inherits:
-
StandardError
- Object
- StandardError
- Rsplunk::APIError
- Defined in:
- lib/rsplunk/api_error.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(error, response) ⇒ APIError
constructor
A new instance of APIError.
- #message ⇒ Object (also: #to_s)
Constructor Details
#initialize(error, response) ⇒ APIError
Returns a new instance of APIError.
7 8 9 10 |
# File 'lib/rsplunk/api_error.rb', line 7 def initialize(error, response) @code = error.status @response = response end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
4 5 6 |
# File 'lib/rsplunk/api_error.rb', line 4 def code @code end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
5 6 7 |
# File 'lib/rsplunk/api_error.rb', line 5 def response @response end |
Instance Method Details
#message ⇒ Object Also known as: to_s
12 13 14 |
# File 'lib/rsplunk/api_error.rb', line 12 def "(#{@code}):#{@response}" end |