Description
Is your feature request related to a problem? Please describe.
It's not clear to me what steps are required to handle errors.
- The 8.x documentation mentions nothing except a brief summary of
ThrowExceptions()
. - The 7.x documentation has useful information on expected and unexpected exceptions, but there is no straight-forward guidance on which method(s) to use.
- Recommended way of handling errors. #1793 has some useful information, but here also I'm not able to interpret straight-forward guidance from it.
I'm mostly wondering if ThrowExceptions()
is adequate. Its documentation says:
Instead of following a c/go like error checking on response.IsValid do throw an exception (except when ApiCallDetails.SuccessOrKnownError is false) on the client when a call resulted in an exception on either the client or the Elasticsearch server.
SuccessOrKnownError
is not documented, it is an internal member that appears to check response status codes but I don't know what the implications are. Are known errors related to expected exceptions?
Describe the solution you'd like
An overview of different error handling methods and their pros and cons, without going too much into implementation details.
Describe alternatives you've considered
Searched the GitHub issues and the wider internet.