Represents a container that has exited with a non-zero exit code.
| 133 | |
| 134 | |
| 135 | class ContainerError(DockerException): |
| 136 | """ |
| 137 | Represents a container that has exited with a non-zero exit code. |
| 138 | """ |
| 139 | def __init__(self, container, exit_status, command, image, stderr): |
| 140 | self.container = container |
| 141 | self.exit_status = exit_status |
| 142 | self.command = command |
| 143 | self.image = image |
| 144 | self.stderr = stderr |
| 145 | |
| 146 | err = f": {stderr}" if stderr is not None else "" |
| 147 | super().__init__( |
| 148 | f"Command '{command}' in image '{image}' " |
| 149 | f"returned non-zero exit status {exit_status}{err}" |
| 150 | ) |
| 151 | |
| 152 | |
| 153 | class StreamParseError(RuntimeError): |
no outgoing calls