forked from TrueCloudLab/distribution
Print error for failed HTTP auth request.
Signed-off-by: Kenny Leung <kleung@google.com>
This commit is contained in:
parent
9bf537dede
commit
d38e02c52f
4 changed files with 18 additions and 13 deletions
|
@ -240,7 +240,8 @@ func (th *tokenHandler) fetchToken(params map[string]string) (token *tokenRespon
|
|||
defer resp.Body.Close()
|
||||
|
||||
if !client.SuccessStatus(resp.StatusCode) {
|
||||
return nil, fmt.Errorf("token auth attempt for registry: %s request failed with status: %d %s", req.URL, resp.StatusCode, http.StatusText(resp.StatusCode))
|
||||
err := client.HandleErrorResponse(resp)
|
||||
return nil, fmt.Errorf("token auth attempt for registry: %s request failed with status: %d %s: %q", req.URL, resp.StatusCode, http.StatusText(resp.StatusCode), err)
|
||||
}
|
||||
|
||||
decoder := json.NewDecoder(resp.Body)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue