Error Handling

The SDK raises typed exceptions for every failure mode — network errors, API errors, timeouts, and authentication failures.

Exception hierarchy


Catching errors

ZabyApiError fields

status
int
HTTP status code
message
string
Human-readable summary
code
string
Machine-readable error code
request_id
string
Request identifier for support (Python)
requestId
string
Request identifier for support (TypeScript)
retry_after
int
Seconds to wait before retrying (from Retry-After header)
details
any
Full response body

Status codes

cause
string
Malformed request payload or invalid parameters
cause
string
Missing or invalid API key / JWT
cause
string
Insufficient permissions for the requested operation
cause
string
Resource does not exist
cause
string
Duplicate slug or version conflict
cause
string
Too many requests — back off and retry
Configure retries to handle 429s automatically.
cause
string
Temporary server-side failure — retry with backoff
cause
string
Runtime JWT has expired — generate a new token
cause
string
SSE stream disconnected or malformed event

Error factory

Both SDKs expose a factory function that maps an error code or status to the correct exception subclass — useful when parsing raw API responses:

Retry strategy


Common issues

Ensure you’re using the right credential type:
Verify the resource exists and has been published:
Increase the timeout for long-running operations:
Verify your local server is running:

Debugging

Enable debug logging to inspect requests and responses:

Testing

MockTransport for deterministic testing.

Configuration

Full configuration reference.