Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve documentation for error handling #8217

Open
stijnherreman opened this issue Jun 5, 2024 · 0 comments
Open

Improve documentation for error handling #8217

stijnherreman opened this issue Jun 5, 2024 · 0 comments
Labels

Comments

@stijnherreman
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants