Exception: Algolia::AlgoliaUnreachableHostError

Inherits:
AlgoliaError
  • Object
show all
Defined in:
lib/algolia/error.rb

Overview

Used when hosts are unreachable

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, errors = []) ⇒ AlgoliaUnreachableHostError

Returns a new instance of AlgoliaUnreachableHostError.



15
16
17
18
19
20
21
22
# File 'lib/algolia/error.rb', line 15

def initialize(message, errors = [])
  errors.last&.tap do |last_error|
    message += " Last error for #{last_error[:host]}: #{last_error[:error]}"
  end

  super(message)
  @errors = errors
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



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

def errors
  @errors
end