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: