Skip to content

KheelonaVoiceError

Every failure KheelonaVoice.connect rejects with. After a failed connect(), create a new session (a new client secret) before trying again.

  • Error

new KheelonaVoiceError(code, message, options?): KheelonaVoiceError

"invalid_request" | "invalid_audio" | "unauthenticated" | "secret_expired" | "forbidden" | "origin_not_allowed" | "voice_not_found" | "session_not_found" | "capacity_exhausted" | "partner_limit_reached" | "rate_limited" | "provider_unavailable" | "internal" | "not_found" | "conflict" | "unavailable" | SdkErrorCode

The error code.

string

A readable description. Log it freely.

cause keeps the browser’s own error as Error.cause: don’t log it verbatim, its text can quote connection details.

unknown

boolean

number

KheelonaVoiceError

Error.constructor

code: "invalid_request" | "invalid_audio" | "unauthenticated" | "secret_expired" | "forbidden" | "origin_not_allowed" | "voice_not_found" | "session_not_found" | "capacity_exhausted" | "partner_limit_reached" | "rate_limited" | "provider_unavailable" | "internal" | "not_found" | "conflict" | "unavailable" | SdkErrorCode

What went wrong. Branch on this, not on message.


name: string = 'KheelonaVoiceError'

Error.name


retryable: boolean

Retrying the same call later can succeed.


optional retryAfterMs?: number

How long to wait before retrying, in milliseconds, when the service said so.