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

Silent JSON response decoding failures #32

Open
kcq opened this issue Aug 13, 2017 · 4 comments
Open

Silent JSON response decoding failures #32

kcq opened this issue Aug 13, 2017 · 4 comments

Comments

@kcq
Copy link

kcq commented Aug 13, 2017

response.JSON() doesn't return any errors when there's a failure to decode the response data into the expected structure.

@h2non
Copy link
Owner

h2non commented Aug 14, 2017

You should manage the error via "error" middleware phase, which would be triggered in case of error. See middleware implementation. I will also create a representative example about this.

@kcq
Copy link
Author

kcq commented Aug 31, 2017

What's the purpose of the error return value in the .JSON() method then?

@h2non
Copy link
Owner

h2non commented Sep 1, 2017

Where did you see that?

@h2non
Copy link
Owner

h2non commented Sep 11, 2017

You can see an error middleware handling example here:
https://github.com/h2non/gentleman/blob/master/_examples/error-handler/error.go

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

2 participants