mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
17 lines
454 B
Python
17 lines
454 B
Python
from typing import Optional
|
|
|
|
|
|
class EpcApiError(Exception):
|
|
"""Base for all EPC client errors."""
|
|
|
|
|
|
class EpcNotFoundError(EpcApiError):
|
|
"""Raised when the API returns 404."""
|
|
|
|
|
|
class EpcRateLimitError(EpcApiError):
|
|
"""Raised when the API returns 429 and all retries are exhausted."""
|
|
|
|
def __init__(self, message: str, retry_after: Optional[float] = None) -> None:
|
|
super().__init__(message)
|
|
self.retry_after = retry_after
|