health-apps-backend/exceptions/unauthorized_exception.py

9 lines
295 B
Python

from http import HTTPStatus
from .api_exceptions import ApiException
class UnauthorizedException(ApiException):
"""Exception for unauthorized access errors."""
def __init__(self, message: str = "Failed to authenticate."):
super().__init__(HTTPStatus.UNAUTHORIZED, message)