Skip to main content
Every failure throws a subclass of DreepError, carrying the HTTP status and the API’s message. Catching DreepError catches all of them; the subclasses exist so you can branch on the cases worth handling differently without comparing status codes.
Anything unmapped surfaces as a plain DreepError with its status intact.

Validation errors

A 400 carries the offending fields, so you can map them back onto a form:

Plan limits

A 402 means the project hit a ceiling — storage, transformations, folders, presets or seats. The metadata tells you which, without parsing the message:

What gets retried

Only GET requests are retried — twice, with exponential backoff, on a 429, any 5xx, or a connection failure. Writes are never retried automatically. A repeated upload would store a duplicate asset and bill a second transformation, and the SDK has no way to know whether a request that timed out actually reached the API. Retry those yourself, when your own logic makes it safe to.

Timeouts

Requests time out after 30 seconds and throw DreepConnectionError. Uploads have no default timeout, because a large file legitimately takes longer than any number the SDK could pick. Bound them with a signal: