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

Return a Response instead of attempting to decode HTML response as JSON for errors #66

Open
markerickson-wf opened this issue Sep 15, 2015 · 0 comments

Comments

@markerickson-wf
Copy link

For example, a 403 response (unauthorized) returns an HTML page, but go-rest attempts to decode the body as JSON, and returns a cryptic error such as "invalid character '<' looking for beginning of value" instead of a Response object with the status code.

See https://github.com/Workiva/go-rest/blob/master/rest/client.go#L100 for how a 404 is correctly handled.

Are there any cases where we want to attempt to decode a JSON response if we have a status other than 200 (or 20x)?

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