cloud-api/src/user/exceptions.py
luxferre 83a24a91f4 docs: user module
In-line and Swagger docs improvements on the User module and endpoints
2026-05-20 15:23:40 +01:00

19 lines
468 B
Python

"""
Module specific exceptions for user module
Exceptions:
- List: Description
- Exceptions: Description
"""
from typing import Optional
from fastapi import HTTPException, status
class UserNotFoundException(HTTPException):
def __init__(self, user_id: Optional[int] = None) -> None:
detail = "User not found" if user_id is None else f"User with ID '{user_id}' was not found."
super().__init__(
status_code=status.HTTP_404_NOT_FOUND,
detail=detail,
)