Exception: Rsplunk::APIError
- Inherits:
-
StandardError
- Object
- StandardError
- Rsplunk::APIError
- Defined in:
- lib/rsplunk/api_error.rb
Instance Attribute Summary (collapse)
-
- (Object) code
readonly
Returns the value of attribute code.
-
- (Object) response
readonly
Returns the value of attribute response.
Instance Method Summary (collapse)
-
- (APIError) initialize(error, response)
constructor
A new instance of APIError.
-
- (Object) message
(also: #to_s)
Return the HTTP code and response (404):Unknown sid.
Constructor Details
- (APIError) initialize(error, response)
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
- (Object) code (readonly)
Returns the value of attribute code
4 5 6 |
# File 'lib/rsplunk/api_error.rb', line 4 def code @code end |
- (Object) response (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
- (Object) message Also known as: to_s
Return the HTTP code and response (404):Unknown sid
14 15 16 |
# File 'lib/rsplunk/api_error.rb', line 14 def "(#{@code}):#{@response["response"]["messages"]["msg"]}" end |