Method: Elastic::AppSearch::UnexpectedHTTPException#initialize

Defined in:
lib/elastic/app-search/exceptions.rb

#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