2026-04-06 12:41:49 +01:00
|
|
|
"""
|
|
|
|
|
Module specific exceptions for auth module
|
|
|
|
|
|
|
|
|
|
Exceptions:
|
|
|
|
|
- List: Description
|
|
|
|
|
- Exceptions: Description
|
2026-05-27 14:58:10 +01:00
|
|
|
"""
|
|
|
|
|
from typing import Optional
|
|
|
|
|
|
|
|
|
|
from fastapi import HTTPException, status
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class UnauthorizedException(HTTPException):
|
|
|
|
|
def __init__(self, message: Optional[str] = None) -> None:
|
|
|
|
|
detail = "Not authorized" if not message else message
|
|
|
|
|
super().__init__(
|
|
|
|
|
status_code=status.HTTP_401_UNAUTHORIZED,
|
|
|
|
|
detail=detail,
|
|
|
|
|
)
|