Skip to content

Exceptions

All exceptions inherit from APIError and expose message and status_code attributes.

APIError
├── AuthenticationError
├── RateLimitError
├── TranslationError
├── TTSGenerationError
└── ASRTranscriptionError

khaya.exceptions.APIError(message, status_code)

Bases: Exception

Base class for API errors.

khaya.exceptions.AuthenticationError(message, status_code)

Bases: APIError

Error during authentication.

khaya.exceptions.RateLimitError(message, status_code)

Bases: APIError

Error during rate limiting.

khaya.exceptions.TranslationError(message, status_code)

Bases: APIError

Error during translation.

khaya.exceptions.TTSGenerationError(message, status_code)

Bases: APIError

Error during TTS generation.

khaya.exceptions.ASRTranscriptionError(message, status_code)

Bases: APIError

Error during ASR transcription.