Skip to main content

Error Hierarchy

All SDK errors extend from XpozError. Import them from the package:

Catching Errors

Use instanceof checks to handle specific error types. Always catch more specific errors before the base XpozError:

Error Details

AuthenticationError

Thrown when the access key is invalid, expired, or missing.

OperationTimeoutError

Thrown when an operation exceeds the configured timeout (default: 300,000ms / 5 minutes). The error includes the elapsed time.
If you frequently hit timeouts, increase the timeout when creating the client: new XpozClient({ timeoutMs: 600_000 }). You can also narrow your queries with date filters, field selection, or more specific search terms.

OperationFailedError

Thrown when an operation completes but with an error status. Includes the operationId and error details.

OperationCancelledError

Thrown when an operation is cancelled, typically due to server-side resource management.

Practical Pattern

A robust wrapper that handles all error cases:
For the equivalent error handling patterns in Python, see Python SDK Error Handling. The Python SDK uses try/except with the same error hierarchy but Python exception classes (OperationFailedError, OperationTimeoutError, etc.).