mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
fix inspect error message
This commit is contained in:
parent
40ed10cc32
commit
a89a98e594
1 changed files with 6 additions and 2 deletions
|
@ -654,7 +654,11 @@ func (cli *DockerCli) CmdInspect(args ...string) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
obj, _, err = cli.call("GET", "/images/"+name+"/json", nil)
|
obj, _, err = cli.call("GET", "/images/"+name+"/json", nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(cli.err, "No such image or container: %s\n", name)
|
if strings.Contains(err.Error(), "No such") {
|
||||||
|
fmt.Fprintf(cli.err, "Error: No such image or container: %s\n", name)
|
||||||
|
} else {
|
||||||
|
fmt.Fprintf(cli.err, "%s", err)
|
||||||
|
}
|
||||||
status = 1
|
status = 1
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -669,7 +673,7 @@ func (cli *DockerCli) CmdInspect(args ...string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
if indented.Len() > 0 {
|
if indented.Len() > 0 {
|
||||||
// Remove trailling ','
|
// Remove trailing ','
|
||||||
indented.Truncate(indented.Len() - 1)
|
indented.Truncate(indented.Len() - 1)
|
||||||
}
|
}
|
||||||
fmt.Fprintf(cli.out, "[")
|
fmt.Fprintf(cli.out, "[")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue