Exception: Algolia::AlgoliaHttpError

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) ⇒ AlgoliaHttpError

Returns a new instance of AlgoliaHttpError.



32
33
34
35
36
# File 'lib/algolia/error.rb', line 32

def initialize(code, message)
  self.code = code
  self.http_message = message
  super("#{code}: #{message}")
end

Instance Attribute Details

#codeObject

Returns the value of attribute code.



30
31
32
# File 'lib/algolia/error.rb', line 30

def code
  @code
end

#http_messageObject

Returns the value of attribute http_message.



30
31
32
# File 'lib/algolia/error.rb', line 30

def http_message
  @http_message
end