-
Notifications
You must be signed in to change notification settings - Fork 115
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
How to check for specific types of errors? #292
Comments
@flyte, there is no specific error in the client API. |
How should I check for a 404 error from the server then? |
@rogpeppe FYI for issues with the go client |
@flyte , when server sesponds with an error, in most cases, the returned error by client API is http.Error, where you can check status code. |
Sorry, I still don't understand. I appreciate your responses but you're really going to have to spell it out for me I'm afraid. I recognise that a generic error is returned in this case, so does that mean I can't assert that the bucket was not found as opposed to a connection error, for example? |
All that means, there is no nice solution for your use-case, unfortunately. We will analyze if there should be some improvement in the API for such cases. |
The functions in |
For the non-blocking API I've found at least some errors are not
protocol.MetricError handles some errors detected before any network connection is made. |
I want to look up a bucket by name and create it if it doesn't exist. Something like the following pseudocode:
The text was updated successfully, but these errors were encountered: