diff --git a/integration-cli/docker_cli_inspect_test.go b/integration-cli/docker_cli_inspect_test.go index fef870f5d2..ffdf7526f5 100644 --- a/integration-cli/docker_cli_inspect_test.go +++ b/integration-cli/docker_cli_inspect_test.go @@ -456,3 +456,11 @@ func (s *DockerSuite) TestInspectUnknownObject(c *check.C) { c.Assert(out, checker.Contains, "Error: No such object: foobar") c.Assert(err.Error(), checker.Contains, "Error: No such object: foobar") } + +func (s *DockerSuite) TestInpectInvalidReference(c *check.C) { + // This test should work on both Windows and Linux + out, _, err := dockerCmdWithError("inspect", "FooBar") + c.Assert(err, checker.NotNil) + c.Assert(out, checker.Contains, "Error: No such object: FooBar") + c.Assert(err.Error(), checker.Contains, "Error: No such object: FooBar") +} diff --git a/plugin/store.go b/plugin/store.go index a4bddcf76c..3c780ab93e 100644 --- a/plugin/store.go +++ b/plugin/store.go @@ -232,7 +232,7 @@ func (ps *Store) resolvePluginID(idOrName string) (string, error) { ref, err := reference.ParseNamed(idOrName) if err != nil { - return "", errors.Wrapf(err, "failed to parse %v", idOrName) + return "", errors.WithStack(ErrNotFound(idOrName)) } if _, ok := ref.(reference.Canonical); ok { logrus.Warnf("canonical references cannot be resolved: %v", ref.String())