From 3a08bbc4d29835fe5b8f3d2c5bde442f6a7014a0 Mon Sep 17 00:00:00 2001 From: Peter Waller Date: Thu, 11 Dec 2014 17:57:23 +0000 Subject: [PATCH] Improve message when pushing a non-existent image I was confused earlier when I did: ``` docker push localhost.localdomain:1234/foo ``` Because docker told me: ``` No such id: localhost.localdomain:1234/foo ``` I actually had buried in my mind the solution to this, but the error message confused me because I had recently had some fun trying to get the registry working and therefore thought it was telling me that I didn't have an account on the registry. This pull request makes it unambiguous that the error is that the specified image is unknown. /cc @cpuguy83 Docker-DCO-1.1-Signed-off-by: Peter Waller (github: pwaller) --- graph/graph.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graph/graph.go b/graph/graph.go index 720f6e6963..b6ea22bdc8 100644 --- a/graph/graph.go +++ b/graph/graph.go @@ -88,7 +88,7 @@ func (graph *Graph) Exists(id string) bool { func (graph *Graph) Get(name string) (*image.Image, error) { id, err := graph.idIndex.Get(name) if err != nil { - return nil, err + return nil, fmt.Errorf("could not find image: %v", err) } img, err := image.LoadImage(graph.ImageRoot(id)) if err != nil {