Browse Source

Added help message to invite to login when getting a 401

Sam Alba 12 years ago
parent
commit
3febeb93f5
1 changed files with 3 additions and 0 deletions
  1. 3 0
      registry.go

+ 3 - 0
registry.go

@@ -279,6 +279,9 @@ func (graph *Graph) PullRepository(stdout io.Writer, remote, askedTag string, re
 		return err
 		return err
 	}
 	}
 	defer res.Body.Close()
 	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.
 	// TODO: Right now we're ignoring checksums in the response body.
 	// In the future, we need to use them to check image validity.
 	// In the future, we need to use them to check image validity.
 	if res.StatusCode != 200 {
 	if res.StatusCode != 200 {