From 34d22a4e5ca3761763c1c3b3dd511588d617536e Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Tue, 17 Sep 2019 09:04:22 -0400 Subject: 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 --- libpod/define/exec_codes.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libpod') diff --git a/libpod/define/exec_codes.go b/libpod/define/exec_codes.go index 33d631326..f94616b33 100644 --- a/libpod/define/exec_codes.go +++ b/libpod/define/exec_codes.go @@ -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 } -- cgit v1.2.3-54-g00ecf