Skip to content

Commit

Permalink
add http response to log
Browse files Browse the repository at this point in the history
fix containers/podman#3884
Add http response message log to show server-side error message.

Signed-off-by: Qi Wang <[email protected]>
  • Loading branch information
QiWang19 committed Sep 24, 2019
1 parent dcdb921 commit 12ec408
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docker/docker_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,11 @@ func (c *dockerClient) getBearerToken(ctx context.Context, challenge challenge,
defer res.Body.Close()
switch res.StatusCode {
case http.StatusUnauthorized:
resBody, err := ioutil.ReadAll(res.Body)
if err != nil {
return nil, err
}
logrus.Debugf("%s", string(resBody))
return nil, ErrUnauthorizedForCredentials
case http.StatusOK:
break
Expand Down

0 comments on commit 12ec408

Please sign in to comment.