-
Notifications
You must be signed in to change notification settings - Fork 711
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
Resty Error Handling by the book - can't catch a 404 HTTP status #560
Comments
I'm confused by this too. Right now, instead of using the
I have structs for the errors for this API I'm working on so
It feels weird because every other Go library I've used follows the convention of returning errors in a return value. Curious if anyone has figured this out better. |
@BigBoulard
The way you handled the error in your @peterjmorgan: it seems that what your doing in your |
Hi,
I struggle to understand who error handling is working using Resty.
I make a
PUT
API call that returns a 404 HTTP status code but I can catch it in the code below.I've tried to use
resp.IsError()
without sucess.I've read some similar topic here which uses the
SetError
method on a struct (Error
orResponse
depending on the case), but this method is maybe specifically tied to a marshalling error when using theSetResult
method.Do you have king of a simple example to understand the good way to handle error using
Resty
?That would be awesome.
Best.
The text was updated successfully, but these errors were encountered: