Exception: Algolia::AlgoliaProtocolError
- Inherits:
-
AlgoliaError
- Object
- StandardError
- AlgoliaError
- Algolia::AlgoliaProtocolError
- 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.
-
#message ⇒ Object
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(code, message) ⇒ AlgoliaProtocolError
constructor
A new instance of AlgoliaProtocolError.
Constructor Details
#initialize(code, message) ⇒ AlgoliaProtocolError
Returns a new instance of AlgoliaProtocolError.
16 17 18 19 20 |
# File 'lib/algolia/error.rb', line 16 def initialize(code, ) self.code = code self. = super("#{self.code}: #{self.}") end |
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
13 14 15 |
# File 'lib/algolia/error.rb', line 13 def code @code end |
#message ⇒ Object
Returns the value of attribute message.
14 15 16 |
# File 'lib/algolia/error.rb', line 14 def @message end |