# tinker._exceptions

Exception hierarchy for the Tinker SDK. All exceptions inherit from `TinkerError`.

```
TinkerError
├── APIError
│   ├── APIResponseValidationError
│   ├── APIStatusError
│   │   ├── BadRequestError (400)
│   │   ├── AuthenticationError (401)
│   │   ├── PermissionDeniedError (403)
│   │   ├── NotFoundError (404)
│   │   ├── ConflictError (409)
│   │   ├── UnprocessableEntityError (422)
│   │   ├── RateLimitError (429)
│   │   └── InternalServerError (500+)
│   └── APIConnectionError
│       └── APITimeoutError
├── SidecarError
│   ├── SidecarStartupError
│   ├── SidecarDiedError
│   └── SidecarIPCError
└── RequestFailedError
```

| Exception | Base | Description |
| --- | --- | --- |
| [`TinkerError`](https://tinker-docs.thinkingmachines.ai/tinker/api-reference/exceptions/tinkererror/) | `Exception` | Base exception for all Tinker-related errors. |
| [`APIError`](https://tinker-docs.thinkingmachines.ai/tinker/api-reference/exceptions/apierror/) | `TinkerError` | Base class for all API-related errors. |
| [`APIResponseValidationError`](https://tinker-docs.thinkingmachines.ai/tinker/api-reference/exceptions/apiresponsevalidationerror/) | `APIError` | Raised when API response doesn't match expected schema. |
| [`APIStatusError`](https://tinker-docs.thinkingmachines.ai/tinker/api-reference/exceptions/apistatuserror/) | `APIError` | Raised when an API response has a status code of 4xx or 5xx. |
| [`APIConnectionError`](https://tinker-docs.thinkingmachines.ai/tinker/api-reference/exceptions/apiconnectionerror/) | `APIError` | Raised when a connection error occurs while making an API request. |
| [`APITimeoutError`](https://tinker-docs.thinkingmachines.ai/tinker/api-reference/exceptions/apitimeouterror/) | `APIConnectionError` | Raised when an API request times out. |
| [`BadRequestError`](https://tinker-docs.thinkingmachines.ai/tinker/api-reference/exceptions/badrequesterror/) | `APIStatusError` | HTTP 400: The request was invalid or malformed. |
| [`AuthenticationError`](https://tinker-docs.thinkingmachines.ai/tinker/api-reference/exceptions/authenticationerror/) | `APIStatusError` | HTTP 401: Authentication credentials are missing or invalid. |
| [`PermissionDeniedError`](https://tinker-docs.thinkingmachines.ai/tinker/api-reference/exceptions/permissiondeniederror/) | `APIStatusError` | HTTP 403: Insufficient permissions to access the resource. |
| [`NotFoundError`](https://tinker-docs.thinkingmachines.ai/tinker/api-reference/exceptions/notfounderror/) | `APIStatusError` | HTTP 404: The requested resource was not found. |
| [`ConflictError`](https://tinker-docs.thinkingmachines.ai/tinker/api-reference/exceptions/conflicterror/) | `APIStatusError` | HTTP 409: The request conflicts with the current state of the resource. |
| [`UnprocessableEntityError`](https://tinker-docs.thinkingmachines.ai/tinker/api-reference/exceptions/unprocessableentityerror/) | `APIStatusError` | HTTP 422: The request was well-formed but contains semantic errors. |
| [`RateLimitError`](https://tinker-docs.thinkingmachines.ai/tinker/api-reference/exceptions/ratelimiterror/) | `APIStatusError` | HTTP 429: Too many requests, rate limit exceeded. |
| [`InternalServerError`](https://tinker-docs.thinkingmachines.ai/tinker/api-reference/exceptions/internalservererror/) | `APIStatusError` | HTTP 500+: An error occurred on the server. |
| [`SidecarError`](https://tinker-docs.thinkingmachines.ai/tinker/api-reference/exceptions/sidecarerror/) | `TinkerError` | Base exception for subprocess sidecar errors. |
| [`SidecarStartupError`](https://tinker-docs.thinkingmachines.ai/tinker/api-reference/exceptions/sidecarstartuperror/) | `SidecarError` | Raised when the sidecar subprocess fails to start or times out. |
| [`SidecarDiedError`](https://tinker-docs.thinkingmachines.ai/tinker/api-reference/exceptions/sidecardiederror/) | `SidecarError` | Raised when the sidecar subprocess exits unexpectedly while requests are pending. |
| [`SidecarIPCError`](https://tinker-docs.thinkingmachines.ai/tinker/api-reference/exceptions/sidecaripcerror/) | `SidecarError` | Raised when communication with the sidecar subprocess fails. |
| [`RequestFailedError`](https://tinker-docs.thinkingmachines.ai/tinker/api-reference/exceptions/requestfailederror/) | `TinkerError` | Raised when an asynchronous request completes in a failed state. |
