Zeli AvatarDeveloper docs

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,
    VoiceTurnError,
    VoiceSocketError,
)

ZeliError

Base class for all SDK errors.

AttributeTypeDescription
messagestrHuman-readable description.
codestr | NoneStable, machine-readable code (e.g. "unauthorized", "timeout").

str(error) renders as [code] message when a code is present.

Subclasses

ExceptionRaised when
ConfigurationErrorThe client or avatar configuration is invalid or incomplete (e.g. both avatar_id and avatar_config, or an empty server_url).
AuthenticationErrorThe API key / session token was rejected by the server.
ConnectionErrorThe transport (HTTP signalling or WebRTC) failed to establish or dropped.
SessionErrorThe server refused to start a session, or an operation failed (e.g. talk() without the control gateway).
TimeoutErrorAn operation did not complete within its allotted time.
VoiceTurnErrorOne turn on the microphone socket failed, on a socket that is still good.
VoiceSocketErrorThe microphone socket is in trouble, rather than one turn on it.
The two voice failures are not interchangeable

A VoiceTurnError means this turn could not be answered and the socket is still listening, so the next one can still work. A VoiceSocketError is the socket: when fatal is true a close follows immediately, and close_code carries the server's own reason, which says whether the session was retired rather than the microphone refused, and whether dialling again is worth anything. Both arrive as ZeliEvent.ERROR; the type is what separates them.

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.

Zeli Avatar · real-time avatars over WebRTC · self-hostable · AU data residency · source