Skip to main content
All SDKs raise or throw a typed exception class when the API returns an error. The exception carries the HTTP status, a machine-readable error code, the request ID, and provider-specific details where applicable.

Catching errors

Mid-stream errors raise the same MeshAPIError from inside the iterator.

Error field names by language

Error codes

error.code is stable and safe to branch on. The complete list — every code the API returns, which side of the call it belongs to, and what to do about it — is the Error Reference. stream_interrupted is the one code not in that list: the Python and Go SDKs raise it client-side when a stream drops mid-response (see Automatic retries below), rather than receiving it from the API.

Automatic retries

Non-streaming create() requests are retried automatically on 429, 502, 503, and 504 with exponential backoff. The Retry-After header is respected on 429 responses. Streams never retry automatically. If a stream drops mid-response, the client raises an error and you need to restart the request manually. See Streaming — Stream recovery.

Configuring retries (Python)