Skip to content

Commit 3febeb9

Browse files
samalbashin-
authored andcommitted
Added help message to invite to login when getting a 401
1 parent bcdf030 commit 3febeb9

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

registry.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,9 @@ func (graph *Graph) PullRepository(stdout io.Writer, remote, askedTag string, re
279279
return err
280280
}
281281
defer res.Body.Close()
282+
if res.StatusCode == 401 {
283+
return fmt.Errorf("Please login first (HTTP code %d)", res.StatusCode)
284+
}
282285
// TODO: Right now we're ignoring checksums in the response body.
283286
// In the future, we need to use them to check image validity.
284287
if res.StatusCode != 200 {

0 commit comments

Comments
 (0)