Merge pull request #4001 from corhere/run-eisdir

cli/command/container: exit 126 on EISDIR error
This commit is contained in:
Sebastiaan van Stijn 2023-02-06 12:33:34 +01:00 committed by GitHub
commit 7abb189120
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -308,7 +308,8 @@ func runStartContainerErr(err error) error {
strings.Contains(trimmedErr, "no such file or directory") || strings.Contains(trimmedErr, "no such file or directory") ||
strings.Contains(trimmedErr, "system cannot find the file specified") { strings.Contains(trimmedErr, "system cannot find the file specified") {
statusError = cli.StatusError{StatusCode: 127} statusError = cli.StatusError{StatusCode: 127}
} else if strings.Contains(trimmedErr, syscall.EACCES.Error()) { } else if strings.Contains(trimmedErr, syscall.EACCES.Error()) ||
strings.Contains(trimmedErr, syscall.EISDIR.Error()) {
statusError = cli.StatusError{StatusCode: 126} statusError = cli.StatusError{StatusCode: 126}
} }