2026-04-06 12:41:49 +01:00
|
|
|
"""
|
|
|
|
|
Module specific exceptions for organisation module
|
|
|
|
|
|
|
|
|
|
Exceptions:
|
|
|
|
|
- List: Description
|
|
|
|
|
- Exceptions: Description
|
2026-05-27 12:21:03 +01:00
|
|
|
"""
|
|
|
|
|
from typing import Optional
|
|
|
|
|
|
|
|
|
|
from fastapi import HTTPException, status
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class OrgNotFoundException(HTTPException):
|
|
|
|
|
def __init__(self, org_id: Optional[int] = None) -> None:
|
|
|
|
|
detail = "Organisation not found" if org_id is None else f"User with ID '{org_id}' was not found."
|
|
|
|
|
super().__init__(
|
|
|
|
|
status_code=status.HTTP_404_NOT_FOUND,
|
|
|
|
|
detail=detail,
|
|
|
|
|
)
|