from typing import ClassVar class ApiException(Exception): HTTP_CODE: ClassVar[int] MESSAGE: ClassVar[str] def __init__(self, message: str | None = None) -> None: self.message = message or self.MESSAGE class NotFound(ApiException): HTTP_CODE = 404 MESSAGE = "Not found" class Unauthorized(ApiException): HTTP_CODE = 401 MESSAGE = "Unathorized"