docs: user module
In-line and Swagger docs improvements on the User module and endpoints
This commit is contained in:
parent
6871fcd75d
commit
83a24a91f4
3 changed files with 105 additions and 34 deletions
|
|
@ -4,4 +4,16 @@ 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,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue