General: ES response errors

Hi,

Is there any way to distinguish error messages in responses between errors
due to request error (eg wrong format etc) that will always be returned for
specified request and errors due to server problems. I need to know when
should I retry the request and when not. Eg, the response error due to
server error is 'UnavailableShardsException', and with such error I should
retry the request until success. The response error due to request problem
is eg 'SearchPhaseExecutionException' - here I should give up running this
request because it will never succeed.

Thanks.
Best regards.
Marcin Dojwa

--

This is probably much more kludgy that what you're looking for, but you
could use the validate API to ensure the request is valid:

On Friday, December 7, 2012 7:14:44 AM UTC-8, Marcin Dojwa wrote:

Hi,

Is there any way to distinguish error messages in responses between errors
due to request error (eg wrong format etc) that will always be returned for
specified request and errors due to server problems. I need to know when
should I retry the request and when not. Eg, the response error due to
server error is 'UnavailableShardsException', and with such error I should
retry the request until success. The response error due to request problem
is eg 'SearchPhaseExecutionException' - here I should give up running this
request because it will never succeed.

Thanks.
Best regards.
Marcin Dojwa

--

I guess I can use it if there is no other way, I will do the _validate
request on each response error to check if I should give up or retry the
request. Thanks :slight_smile: Do you know how _validate works when I pass a request
that throws 'UnavailableShardsException'? Do I get "valid":true or '
UnavailableShardsException' error too ?

2012/12/7 Anil Rhemtulla anil.rhemtulla@gmail.com

This is probably much more kludgy that what you're looking for, but you
could use the validate API to ensure the request is valid:
Elasticsearch Platform — Find real-time answers at scale | Elastic

On Friday, December 7, 2012 7:14:44 AM UTC-8, Marcin Dojwa wrote:

Hi,

Is there any way to distinguish error messages in responses between
errors due to request error (eg wrong format etc) that will always be
returned for specified request and errors due to server problems. I need to
know when should I retry the request and when not. Eg, the response error
due to server error is 'UnavailableShardsException', and with such error I
should retry the request until success. The response error due to request
problem is eg '**SearchPhaseExecutionException' - here I should give up
running this request because it will never succeed.

Thanks.
Best regards.
Marcin Dojwa

--

--