Exception: Elastic::AppSearch::UnexpectedHTTPException

Inherits:
ClientException
  • Object
show all
Defined in:
lib/elastic/app-search/exceptions.rb

Instance Attribute Summary

Attributes inherited from ClientException

#errors

Instance Method Summary collapse

Methods inherited from ClientException

#extract_messages

Constructor Details

#initialize(response, response_json) ⇒ UnexpectedHTTPException

Returns a new instance of UnexpectedHTTPException.



28
29
30
31
# File 'lib/elastic/app-search/exceptions.rb', line 28

def initialize(response, response_json)
  errors = (response_json['errors'] || [response.message]).map { |e| "(#{response.code}) #{e}" }
  super({ 'errors' => errors })
end