From c944598d4294e3b74505fa39086d8dff650ecebf Mon Sep 17 00:00:00 2001 From: Qi Wang Date: Tue, 24 Sep 2019 15:26:23 -0400 Subject: [PATCH] getBearerToken returns http response error fix https://github.com/containers/libpod/issues/3884 Returns http response error message from server-side. Signed-off-by: Qi Wang --- docker/docker_client.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker/docker_client.go b/docker/docker_client.go index 48427f3d37..3a33335fea 100644 --- a/docker/docker_client.go +++ b/docker/docker_client.go @@ -533,7 +533,8 @@ func (c *dockerClient) getBearerToken(ctx context.Context, challenge challenge, defer res.Body.Close() switch res.StatusCode { case http.StatusUnauthorized: - return nil, ErrUnauthorizedForCredentials + err := client.HandleErrorResponse(res) + return nil, err case http.StatusOK: break default: