mirror of
https://github.com/containers/podman.git
synced 2025-10-16 18:53:19 +08:00
Fix exit code failure
Be less precise on the exit code and lot the exit code to the journal when it fails. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
@ -4,6 +4,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -39,8 +40,9 @@ func ExitCode(err error) int {
|
||||
return 0
|
||||
}
|
||||
e := strings.ToLower(err.Error())
|
||||
if strings.Contains(e, "file not found") ||
|
||||
strings.Contains(e, "no such file or directory") {
|
||||
logrus.Debugf("ExitCode msg: %q", e)
|
||||
if strings.Contains(e, "not found") ||
|
||||
strings.Contains(e, "no such file") {
|
||||
return ExecErrorCodeNotFound
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user