Exception: Algolia::AlgoliaProtocolError

Inherits:
AlgoliaError
  • Object
show all
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

Instance Method Summary collapse

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, message)
  self.code = code
  self.message = message
  super("#{self.code}: #{self.message}")
end

Instance Attribute Details

#codeObject

Returns the value of attribute code.



13
14
15
# File 'lib/algolia/error.rb', line 13

def code
  @code
end

#messageObject

Returns the value of attribute message.



14
15
16
# File 'lib/algolia/error.rb', line 14

def message
  @message
end