from __future__ import annotations class ServiceClientError(RuntimeError): """Base service-client error.""" class ServiceConfigError(ServiceClientError): """Raised when service client configuration is missing or invalid.""" class ServiceUnavailableError(ServiceClientError): """Raised when a service cannot be reached or is temporarily blocked.""" class ServiceHTTPError(ServiceClientError): """Raised for non-2xx HTTP responses.""" def __init__(self, service: str, status_code: int, body: str) -> None: self.service = service self.status_code = status_code self.body = body super().__init__(f"service {service} returned HTTP {status_code}")