Skip to content

treat non-JSON responses well#24

Open
joesis wants to merge 5 commits into
keighl:masterfrom
getlantern:master
Open

treat non-JSON responses well#24
joesis wants to merge 5 commits into
keighl:masterfrom
getlantern:master

Conversation

@joesis

@joesis joesis commented Oct 24, 2019

Copy link
Copy Markdown

No description provided.

Comment thread mandrill.go Outdated
if err != nil {
return nil, fmt.Errorf("HTTP %v: %v", resp.StatusCode, string(body))
}
return body, resError

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

If the http response is not in JSON format, resError would be empty. In such case it's better to pass the status and message back to the caller.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-1.4%) to 95.522% when pulling 7094d8b on getlantern:master into 1775dd4 on keighl:master.

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