wrap JSON decode error with meaning full data

pull/6566/head
Nathaniel Cook 2016-05-05 16:09:08 -06:00
parent c6518b564f
commit 80be8f0e6c
1 changed files with 1 additions and 1 deletions

View File

@ -576,7 +576,7 @@ func (c *client) Query(q Query) (*Response, error) {
}
// If we got a valid decode error, send that back
if decErr != nil {
return nil, decErr
return nil, fmt.Errorf("unable to decode json: received status code %d err: %s", resp.StatusCode, decErr)
}
// If we don't have an error in our json response, and didn't get statusOK
// then send back an error