mirror of
https://github.com/docker/compose.git
synced 2026-08-04 06:38:45 +00:00
Retrieve compose failure category by exit code
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
d8aa00a766
commit
db38d1244c
5 changed files with 29 additions and 10 deletions
|
|
@ -294,7 +294,7 @@ func exit(ctx string, err error, ctype string) {
|
|||
|
||||
if errors.Is(err, errdefs.ErrNotImplemented) {
|
||||
name := metrics.GetCommand(os.Args[1:])
|
||||
fmt.Fprintf(os.Stderr, "RootCommand %q not available in current context (%s)\n", name, ctx)
|
||||
fmt.Fprintf(os.Stderr, "Command %q not available in current context (%s)\n", name, ctx)
|
||||
|
||||
os.Exit(1)
|
||||
}
|
||||
|
|
@ -314,7 +314,7 @@ func checkIfUnknownCommandExistInDefaultContext(err error, currentContext string
|
|||
dockerCommand := string(submatch[1])
|
||||
|
||||
if mobycli.IsDefaultContextCommand(dockerCommand) {
|
||||
fmt.Fprintf(os.Stderr, "RootCommand %q not available in current context (%s), you can use the \"default\" context to run this command\n", dockerCommand, currentContext)
|
||||
fmt.Fprintf(os.Stderr, "Command %q not available in current context (%s), you can use the \"default\" context to run this command\n", dockerCommand, currentContext)
|
||||
metrics.Track(contextType, os.Args[1:], metrics.FailureStatus)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue