Elistix v1.0.1 Elistix.Response

HTTPoison doesn’t know when Elasticsearch fails so it returns a tuple with :ok and the response, so you can never know when something happens in Elasticsearch before explode in your code. This module catch the responses with status code 400 or 404 and build a new response with the :error in the tuple.

Summary

Functions

Here the response is captured and a new one is builded with the :error in the tuple if the status code is 400 or 404 or the response is returned without any change

Functions

parse_response(response)

Here the response is captured and a new one is builded with the :error in the tuple if the status code is 400 or 404 or the response is returned without any change.