YoukaRequestError for HTTP and validation failures, and YoukaTaskError for async tasks that ended in a non-successful state. Both extend Error and carry structured fields so you can branch on code, status, and retryability.
YoukaRequestError
Thrown for HTTP errors, request validation failures, and malformed responses.
Fields
true if the SDK considers the error worth retrying (rate limits, transient
server errors, idempotent replay in progress).Common codes
YoukaTaskError
Thrown from client.tasks.wait(...), client.projects.wait(...), and client.exports.wait(...) when the underlying task or export ends in failed, cancelled, or timed-out.
Fields
The full task payload at the moment of failure. Useful for logging and
user-facing error messages.
Retry pattern
Combineretryable with an idempotency key to build a safe retry loop:
Abort and cancellation
Aborting a request throws a standardAbortError — not a YoukaRequestError. Check for it explicitly:
What’s next
- Tasks — wait helpers and advanced task polling
- Authentication — constructor options and signals
- API errors — the same codes in raw HTTP
