from fastapi import HTTPException, status class UnauthorizedException(HTTPException): """Custom exception for unauthorized access attempts.""" def __init__(self, detail: str): super().__init__( status_code=status.HTTP_401_UNAUTHORIZED, detail=detail, )