Spaces:
Sleeping
Sleeping
File size: 513 Bytes
699677f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | """Typed application errors."""
from __future__ import annotations
from dataclasses import dataclass
from typing import Any
@dataclass
class AppError(Exception):
"""Base application error with a code and message."""
code: str
message: str
details: dict[str, Any] | None = None
class ValidationError(AppError):
"""Raised when client input is invalid."""
class SpeechError(AppError):
"""Raised when STT/TTS fails."""
class LLMError(AppError):
"""Raised when LLM call fails."""
|