diff options
author | Peter Hunt <pehunt@redhat.com> | 2019-07-23 15:30:05 -0400 |
---|---|---|
committer | Peter Hunt <pehunt@redhat.com> | 2019-07-23 16:49:04 -0400 |
commit | 01a8483a59eed8bc706b5219b903704544b66c10 (patch) | |
tree | a4d389c4964cba790ea3b483a3d0265bb53778d1 /pkg/adapter | |
parent | 82dce36fb6ef3839c029b7450a75c85cf28cf377 (diff) | |
download | podman-01a8483a59eed8bc706b5219b903704544b66c10.tar.gz podman-01a8483a59eed8bc706b5219b903704544b66c10.tar.bz2 podman-01a8483a59eed8bc706b5219b903704544b66c10.zip |
refactor to reduce duplicated error parsing
Signed-off-by: Peter Hunt <pehunt@redhat.com>
Diffstat (limited to 'pkg/adapter')
-rw-r--r-- | pkg/adapter/containers.go | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/pkg/adapter/containers.go b/pkg/adapter/containers.go index a8bff187c..faaef3e60 100644 --- a/pkg/adapter/containers.go +++ b/pkg/adapter/containers.go @@ -1001,13 +1001,7 @@ func (r *LocalRuntime) ExecContainer(ctx context.Context, cli *cliconfig.ExecVal streams.AttachError = true ec, err = ExecAttachCtr(ctx, ctr.Container, cli.Tty, cli.Privileged, envs, cmd, cli.User, cli.Workdir, streams, cli.PreserveFDs, cli.DetachKeys) - if errors.Cause(err) == define.ErrOCIRuntimePermissionDenied { - ec = 126 - } - if errors.Cause(err) == define.ErrOCIRuntimeNotFound { - ec = 127 - } - return ec, err + return define.TranslateExecErrorToExitCode(ec, err), err } // Prune removes stopped containers |