You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
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 theError
type in thegithub.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 a410
response code rather than a transient network failure?The text was updated successfully, but these errors were encountered: