from fastapi import HTTPException, status class TodoNotFoundException(HTTPException): def __init__(self, todo_id: int): super().__init__( status_code=status.HTTP_404_NOT_FOUND, detail=f"Todo with ID {todo_id} not found", ) class ValidationError(HTTPException): def __init__(self, detail: str): super().__init__( status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, detail=detail, ) class DatabaseError(HTTPException): def __init__(self, detail: str = "Database error occurred"): super().__init__( status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=detail, )