mirror of
https://github.com/docker/compose.git
synced 2026-06-25 02:28:24 +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
|
|
@ -68,12 +68,8 @@ func Exec(root *cobra.Command) {
|
|||
if err != nil {
|
||||
if exiterr, ok := err.(*exec.ExitError); ok {
|
||||
exitCode := exiterr.ExitCode()
|
||||
if exitCode == 130 {
|
||||
metrics.Track(store.DefaultContextType, os.Args[1:], metrics.CanceledStatus)
|
||||
} else {
|
||||
metrics.Track(store.DefaultContextType, os.Args[1:], metrics.FailureStatus)
|
||||
}
|
||||
os.Exit(exiterr.ExitCode())
|
||||
metrics.Track(store.DefaultContextType, os.Args[1:], metrics.ByExitCode(exitCode).MetricsStatus)
|
||||
os.Exit(exitCode)
|
||||
}
|
||||
metrics.Track(store.DefaultContextType, os.Args[1:], metrics.FailureStatus)
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue