Error Hierarchy
All SDK errors extend fromXpozError. Import them from the package:
Catching Errors
Useinstanceof 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.OperationFailedError
Thrown when an operation completes but with an error status. Includes theoperationId 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.).
