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

Further information on requests returning an error #12

Open
jen20 opened this issue Jan 2, 2016 · 0 comments
Open

Further information on requests returning an error #12

jen20 opened this issue Jan 2, 2016 · 0 comments

Comments

@jen20
Copy link
Contributor

jen20 commented Jan 2, 2016

There are occasions where it is desirable to be able to get more information about a failed request. For example, upon deleting a machine, it is useful to be able to poll using GetMachine in order to determine when it has actually been deleted.

Unfortunately at the moment there is no way beyond string parsing (that I have found - not to say it doesn't exist!) to determine that a call to GetMachine failed because the machine does not exist versus for example a transient network failure - this includes traversing the Error type in the github.com/joyent/gocommon/errors package. It would be useful if in the case of error, some additional request context could be included on a struct to which one could type assert the error - for example the status code.

Is there a simpler way of knowing that, for example, a call to GetMachine has failed because of a 410 response code rather than a transient network failure?

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

No branches or pull requests

1 participant