Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
658 B · 29 lines
Python
at main
123456789101112131415161718192021222324252627282930class AppServiceError(Exception): """Base class for service-layer errors."""
status_code: int = 500 error_code: str = "APP_SERVICE_ERROR"
def __init__(self, message: str) -> None: super().__init__(message) self.message = message
class NotFoundError(AppServiceError): status_code = 404 error_code = "NOT_FOUND"
class BadRequestError(AppServiceError): status_code = 400 error_code = "BAD_REQUEST"
class UnauthorizedError(AppServiceError): status_code = 401 error_code = "UNAUTHORIZED"
class ServiceUnavailableError(AppServiceError): status_code = 503 error_code = "SERVICE_UNAVAILABLE"