Python SDK / Errors
Errors
Every error the SDK raises derives from ZeliError, so you can catch
the base type broadly or a specific subclass narrowly.
from zeli import (
ZeliError,
ConfigurationError,
AuthenticationError,
ConnectionError,
SessionError,
TimeoutError,
)ZeliError
Base class for all SDK errors.
| Attribute | Type | Description |
|---|---|---|
message | str | Human-readable description. |
code | str | None | Stable, machine-readable code (e.g. "unauthorized", "timeout"). |
str(error) renders as [code] message when a code is present.
Subclasses
| Exception | Raised when |
|---|---|
ConfigurationError | The client or avatar configuration is invalid or incomplete (e.g. both avatar_id and avatar_config, or an empty server_url). |
AuthenticationError | The API key / session token was rejected by the server. |
ConnectionError | The transport (HTTP signalling or WebRTC) failed to establish or dropped. |
SessionError | The server refused to start a session, or an operation failed (e.g. talk() without the control gateway). |
TimeoutError | An operation did not complete within its allotted time. |
Catch ZeliError to handle anything the SDK throws, or a specific
subclass to react to a particular failure. See the
error-handling guide for patterns.