> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ns.rocks/llms.txt
> Use this file to discover all available pages before exploring further.

# Errors And Types

> Python SDK object reference for public exception classes and typed result objects.

The SDK raises typed exceptions for common integration failures and returns
typed objects for machine, process, file, template, volume, desktop, SSH relay,
and code interpreter data.

## Exceptions

| Exception         | Use                                                         |
| ----------------- | ----------------------------------------------------------- |
| `MachineError`    | Base SDK/runtime error.                                     |
| `AuthError`       | Missing, invalid, or rejected API credentials.              |
| `NotFoundError`   | Machine, snapshot, volume, template, or file was not found. |
| `TimeoutError`    | Operation exceeded its configured timeout.                  |
| `BuildError`      | Template build failed.                                      |
| `FileUploadError` | Upload failed; may include an `upload_id` for resume.       |
| `GitError`        | Git helper operation failed.                                |
| `BatchWriteError` | Multi-file write partially failed.                          |

```python theme={"theme":{"light":"one-light","dark":"one-dark-pro"}}
from nullspace import AuthError, Machine, TimeoutError

try:
    machine = Machine.create(template="base", timeout=30)
except AuthError:
    print("check NULLSPACE_API_KEY")
except TimeoutError:
    print("machine did not become ready in time")
```

## Typed Results

Common result objects include machine info, command result, process info,
upload/download result, template build status, volume info, lifecycle events,
desktop stream info, PTY result, `PreviewUrl`, `PreviewGrantInfo`,
`PreviewReadiness`, `PreviewProxyTarget`, `RevokePreviewGrantResponse`,
`SshAccess` certificate relay metadata, code execution, code contexts, code
runs, and artifacts. Field names match the Python SDK types and the generated
OpenAPI schemas where possible.
`PreviewGrantInfo` includes safe grant inventory fields such as first/last use,
HTTP request count, WebSocket connection count, byte counters, last error
code/time, and disabled time.

Use `redact_preview_url(...)` and `redact_preview_token(...)` before displaying
preview bearer credentials in logs, terminals, or support artifacts.

## Related

* [SDK error guide](../../guides/python-sdk/errors-types)
* [Error codes](../../error-codes)
* [API reference](../../api-reference)
