Distinguish containerd failure from process exit code
Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>v0.7
parent
e11b881c12
commit
b9cf317850
|
@ -193,7 +193,12 @@ func (w containerdExecutor) Exec(ctx context.Context, meta executor.Meta, root c
|
||||||
cancel()
|
cancel()
|
||||||
}
|
}
|
||||||
if status.ExitCode() != 0 {
|
if status.ExitCode() != 0 {
|
||||||
err := errors.Errorf("process returned non-zero exit code: %d", status.ExitCode())
|
var err error
|
||||||
|
if status.ExitCode() == containerd.UnknownExitStatus && status.Error() != nil {
|
||||||
|
err = errors.Wrap(status.Error(), "failure waiting for process")
|
||||||
|
} else {
|
||||||
|
err = errors.Errorf("process returned non-zero exit code: %d", status.ExitCode())
|
||||||
|
}
|
||||||
select {
|
select {
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
err = errors.Wrap(ctx.Err(), err.Error())
|
err = errors.Wrap(ctx.Err(), err.Error())
|
||||||
|
|
Loading…
Reference in New Issue