NewContainerExit returns a container failure with the encoded exit code. If the exit code is a the zero value, no failure is returned.
(code ExitCode)
| 65 | // NewContainerExit returns a container failure with the encoded exit code. If the exit code is a |
| 66 | // the zero value, no failure is returned. |
| 67 | func NewContainerExit(code ExitCode) *ContainerFailureError { |
| 68 | if code == SuccessExitCode { |
| 69 | return nil |
| 70 | } |
| 71 | return &ContainerFailureError{ |
| 72 | FailureType: ContainerFailed, |
| 73 | ErrMsg: errors.Errorf("%s: %d", ContainerFailed, code).Error(), |
| 74 | ExitCode: &code, |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | // ContainerExited returns a container failure with the encoded exit code. If the exit code is a |
| 79 | // the zero value, no failure is returned. |