Source code for contree_sdk.exceptions
[docs]
class FailedOperationError(Exception):
"""An operation reached a terminal non-SUCCESS status with no result at all.
A nonzero exit code is a normal `InstanceResult`, not an error - this is
only raised for an operation-level failure (e.g. the VM couldn't start).
"""
def __init__(self, operation_uuid: str, error: str | None) -> None:
super().__init__(f"operation {operation_uuid} failed: {error}")
self.operation_uuid = operation_uuid
self.error = error
[docs]
class DockerBuildError(Exception):
"""A Dockerfile build step failed (nonzero RUN exit code, unresolvable stage/image reference, etc.)."""
[docs]
class FileWriteError(Exception):
"""A file could not be written to the executor's filesystem."""
def __init__(self, path: str, message: str) -> None:
super().__init__(f"cannot write {path!r}: {message}")
self.path = path
self.message = message