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

# SDK errors

> Typed HTTP errors thrown by the TypeScript SDK, the Python SDK, and the Omni CLI.

Non-2xx responses throw a subclass of `OmniError`. The CLI prints the same class name, message, and JSON body on stderr and exits `1`.

```ts theme={null}
import { OmniClient, NotFoundError, OmniError } from "@omni-commerce/sdk";

try {
  await client.products.get({ productId: "missing" });
} catch (error) {
  if (error instanceof NotFoundError) {
    // 404
  } else if (error instanceof OmniError) {
    console.error(error.statusCode, error.body);
  }
}
```

```python theme={null}
import os
from omnicommerce import NotFoundError, Omni, OmniError

client = Omni(api_key=os.environ["OMNI_API_KEY"])
try:
    client.products.get(product_id="missing")
except NotFoundError:
    pass
except OmniError as error:
    print(error.status_code, error.body)
```

| Class | Status |
| - | - |
| `BadRequestError` | 400 |
| `UnauthorizedError` | 401 |
| `ForbiddenError` | 403 |
| `NotFoundError` | 404 |
| `UnprocessableEntityError` | 422 |
| `TooManyRequestsError` | 429 |
| `InternalServerError` | 500 |
| `BadGatewayError` | 502 |
| `ServiceUnavailableError` | 503 |
| `OmniTimeoutError` | client timeout |
| `JobFailedError` | `jobs.wait` ended `failed` / `cancelled` |

The TypeScript error exposes `statusCode`, `body`, and `rawResponse`. The Python error exposes `status_code`, `body`, and `raw_response`. `JobFailedError` also exposes `jobStatus` in TypeScript and `job_status` in Python.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.