Skip to content

Improve error message when JSON messages r empty #31

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

Merged
merged 3 commits into from
Apr 1, 2015

Conversation

aviflax
Copy link
Contributor

@aviflax aviflax commented Mar 30, 2015

This refines a change I made in e77cc7e.

@@ -119,14 +120,18 @@ type jsonErrors struct {
}

func buildError(r *http.Response) error {
// Reading the body into a []byte because we might need to put it into an error
// message after having the JSON decoding fail to produce a message.
body, _ := ioutil.ReadAll(r.Body)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello. I think we should not ignore ioutil.ReadAll error and also handle it. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Check out 24f309d. How’s that look?

le0pard added a commit that referenced this pull request Apr 1, 2015
Improve error message when JSON messages r empty
@le0pard le0pard merged commit ac2b00f into sendgridlabs:master Apr 1, 2015
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

Successfully merging this pull request may close these issues.

3 participants