[Backport] On Internal Server Error, show request witch caused this #297

Merged
zeripath merged 1 commits from 6543/go-sdk:backport_296_500 into release/v0.11 2020-03-31 11:19:39 +00:00

View File

@ -110,6 +110,8 @@ func (c *Client) getResponse(method, path string, header http.Header, body io.Re
return nil, errors.New("409 Conflict")
case 422:
return nil, fmt.Errorf("422 Unprocessable Entity: %s", string(data))
case 500:
return nil, fmt.Errorf("500 Internal Server Error, request: '%s' with '%s' method and '%s' header", path, method, header)
}
if resp.StatusCode/100 != 2 {