Skip to main content

Error hierarchy

Everything the SDK throws extends CestoError. Server responses become typed APIError subclasses; transport problems become connection errors. All classes are exposed on the Cesto client for instanceof checks.
Every APIError carries status, code, requestId, and details from the API, useful when reporting an issue.

Automatic retries

Transient failures (408, 409, 429, 5xx, connection errors, and timeouts) are retried automatically with exponential backoff and jitter, honoring the Retry-After header. Tune with maxRetries (default 2), or disable per request with { maxRetries: 0 }.
One exception: positions.submit is never retried automatically — a submit that timed out client-side may still have been accepted, so poll getExecution instead of re-sending.

Timeouts & cancellation

Each request times out after timeout ms (default 60s), throwing APIConnectionTimeoutError. Pass an AbortSignal to cancel a request yourself: