Coverage for projects/04-llm-adapter-shadow/src/llm_adapter/errors.py: 100%
8 statements
« prev ^ index » next coverage.py v7.10.7, created at 2025-09-24 01:32 +0000
« prev ^ index » next coverage.py v7.10.7, created at 2025-09-24 01:32 +0000
1"""Error hierarchy for the minimal LLM adapter."""
3from __future__ import annotations
6class AdapterError(Exception):
7 """Base class for errors originating from providers or the adapter."""
10class TimeoutError(AdapterError):
11 """Raised when a provider does not respond within the expected window."""
14class RateLimitError(AdapterError):
15 """Raised when a provider rejects the request due to rate limiting."""
18class AuthError(AdapterError):
19 """Raised when credentials are missing or invalid for the provider."""
22class RetriableError(AdapterError):
23 """Raised for transient issues where retrying with another provider may help."""
26class FatalError(AdapterError):
27 """Raised for unrecoverable issues that should halt the runner."""
30__all__ = [
31 "AdapterError",
32 "TimeoutError",
33 "RateLimitError",
34 "AuthError",
35 "RetriableError",
36 "FatalError",
37]