diff --git a/client.go b/client.go index 29784eb..30f5fde 100644 --- a/client.go +++ b/client.go @@ -556,8 +556,15 @@ func (cli *Client) UploadToContentRepo(content io.Reader, contentType string, co return nil, err } if res.StatusCode != 200 { + contents, err := ioutil.ReadAll(res.Body) + if err != nil { + return nil, HTTPError{ + Message: "Upload request failed - Failed to read response body: " + err.Error(), + Code: res.StatusCode, + } + } return nil, HTTPError{ - Message: "Upload request failed", + Message: "Upload request failed: " + string(contents), Code: res.StatusCode, } }