Exception: Algolia::AlgoliaHttpError
- Inherits:
-
AlgoliaError
- Object
- StandardError
- AlgoliaError
- Algolia::AlgoliaHttpError
- Defined in:
- lib/algolia/error.rb
Overview
An exception class raised when the REST API returns an error. The error code and message will be parsed out of the HTTP response, which is also included in the response attribute.
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#http_message ⇒ Object
Returns the value of attribute http_message.
Instance Method Summary collapse
-
#initialize(code, message) ⇒ AlgoliaHttpError
constructor
A new instance of AlgoliaHttpError.
Constructor Details
#initialize(code, message) ⇒ AlgoliaHttpError
Returns a new instance of AlgoliaHttpError.
32 33 34 35 36 |
# File 'lib/algolia/error.rb', line 32 def initialize(code, ) self.code = code self. = super("#{code}: #{}") end |
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
30 31 32 |
# File 'lib/algolia/error.rb', line 30 def code @code end |
#http_message ⇒ Object
Returns the value of attribute http_message.
30 31 32 |
# File 'lib/algolia/error.rb', line 30 def @http_message end |