1
0
mirror of https://github.com/docker/cli.git synced 2026-01-18 08:21:31 +03:00

Added help message to invite to login when getting a 401

Upstream-commit: 3febeb93f553be0dceec81591a6e0ba578b42a12
Component: engine
This commit is contained in:
Sam Alba
2013-05-02 18:57:15 -07:00
committed by shin-
parent db5ba3230b
commit 9633853dc1

View File

@@ -279,6 +279,9 @@ func (graph *Graph) PullRepository(stdout io.Writer, remote, askedTag string, re
return err
}
defer res.Body.Close()
if res.StatusCode == 401 {
return fmt.Errorf("Please login first (HTTP code %d)", res.StatusCode)
}
// TODO: Right now we're ignoring checksums in the response body.
// In the future, we need to use them to check image validity.
if res.StatusCode != 200 {