The SDK maps API failures to MachineError subclasses when it has a stable recovery signal.

Common errors

from nullspace import Machine
from nullspace.errors import AuthError, NotFoundError, MachineError, TimeoutError

try:
    Machine.connect("mch_missing")
except NotFoundError:
    print("machine not found")
except AuthError:
    print("check NULLSPACE_API_KEY")
except TimeoutError:
    print("operation timed out")
except MachineError as error:
    print(error.code, error)

Volume recovery codes

Volume-related MachineError.code values include volume_read_only, volume_invalid_mount_path, volume_overlapping_mounts, volume_backend_capability_unsupported, volume_quota_exceeded, volume_mount_credential_issue_failed, volume_backend_unavailable, volume_busy, and volume_limit_exceeded. volume_backend_capability_unsupported usually means the environment is missing shared-volume backend capability such as Supabase-backed auth or volume storage configuration. This list highlights common recovery signals and is not exhaustive. The canonical API error-code enum is in the API Reference, and CLI-oriented anchors are in Error Codes. Concepts: Create, Destroy. API reference: API Reference.