OmniError. The CLI prints the same class name, message, and JSON body on stderr and exits 1.
OmniError also exposes statusCode, body, and rawResponse when the failure came from HTTP.Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Typed HTTP errors thrown by @omni-commerce/sdk and the Omni CLI.
OmniError. The CLI prints the same class name, message, and JSON body on stderr and exits 1.
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);
}
}
| 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 |
OmniError also exposes statusCode, body, and rawResponse when the failure came from HTTP.