Merge pull request #156 from aknuds1/handle-non-json-errors

Handle non-json errors from the API
This commit is contained in:
Maurício Linhares 2018-03-06 11:16:06 -05:00 committed by GitHub
commit 54622b1d85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -356,7 +356,7 @@ func CheckResponse(r *http.Response) error {
if err == nil && len(data) > 0 {
err := json.Unmarshal(data, errorResponse)
if err != nil {
return err
errorResponse.Message = string(data)
}
}