diff --git a/create.go b/create.go index a27e7c45f..97854b846 100644 --- a/create.go +++ b/create.go @@ -1,6 +1,7 @@ package main import ( + "fmt" "os" "github.com/urfave/cli" @@ -56,12 +57,11 @@ command(s) that get executed on start, edit the args parameter of the spec. See return err } status, err := startContainer(context, CT_ACT_CREATE, nil) - if err != nil { - return err + if err == nil { + // exit with the container's exit status so any external supervisor + // is notified of the exit with the correct exit status. + os.Exit(status) } - // exit with the container's exit status so any external supervisor is - // notified of the exit with the correct exit status. - os.Exit(status) - return nil + return fmt.Errorf("runc create failed: %w", err) }, } diff --git a/run.go b/run.go index 4c46f4f6c..82781669d 100644 --- a/run.go +++ b/run.go @@ -1,6 +1,7 @@ package main import ( + "fmt" "os" "github.com/urfave/cli" @@ -74,6 +75,6 @@ command(s) that get executed on start, edit the args parameter of the spec. See // notified of the exit with the correct exit status. os.Exit(status) } - return err + return fmt.Errorf("runc run failed: %w", err) }, }