Skip to main content

fishaudio.exceptions

Custom exceptions for the Fish Audio SDK.

FishAudioError Objects

Base exception for all Fish Audio SDK errors.

APIError Objects

Raised when the API returns an error response.

AuthenticationError Objects

Raised when authentication fails (401).

PermissionError Objects

Raised when permission is denied (403).

NotFoundError Objects

Raised when a resource is not found (404).

RateLimitError Objects

Raised when rate limit is exceeded (429).

ServerError Objects

Raised when the server encounters an error (5xx).

WebSocketError Objects

Raised when WebSocket connection or streaming fails.

ASRRealtimeError Objects

Raised when a realtime speech-to-text session ends with an error. Attributes:
  • message - A short English description, for humans
  • error_type - Machine-readable error type from the server’s error event (e.g., “invalid_config”, “idle_timeout”). None if the connection closed without one
  • code - HTTP-style status from the server’s error event. None if not sent
  • request_id - Identifier of the request; quote it when reporting a problem
  • close_code - WebSocket close code (e.g., 4400, 4408, 1012). None if the error was raised before the connection closed

ValidationError Objects

Raised when request validation fails.

DependencyError Objects

Raised when a required dependency is missing.