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

Add the mediaType to the error

Without this fix the error the client might see is:
	target is unknown
which wasn't helpful to me when I saw this today. With this fix I
now see:
	MediaType is unknown: 'text/html'
which helped me track down the issue to the registry I was talking to.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 05a3caff23
Component: cli
This commit is contained in:
Doug Davis
2017-01-10 19:27:55 -08:00
parent c312097e9d
commit e1a103614c
2 changed files with 2 additions and 2 deletions

View File

@@ -76,7 +76,7 @@ func runPull(dockerCli *command.DockerCli, opts pullOptions) error {
err = imagePullPrivileged(ctx, dockerCli, authConfig, reference.FamiliarString(distributionRef), requestPrivilege, opts.all)
}
if err != nil {
if strings.Contains(err.Error(), "target is plugin") {
if strings.Contains(err.Error(), "when fetching 'plugin'") {
return errors.New(err.Error() + " - Use `docker plugin install`")
}
return err

View File

@@ -152,7 +152,7 @@ func runInstall(dockerCli *command.DockerCli, opts pluginOptions) error {
responseBody, err := dockerCli.Client().PluginInstall(ctx, alias, options)
if err != nil {
if strings.Contains(err.Error(), "target is image") {
if strings.Contains(err.Error(), "(image) when fetching") {
return errors.New(err.Error() + " - Use `docker image pull`")
}
return err