2025-06-06 13:28:18 +00:00

17 lines
455 B
Python

from fastapi import HTTPException, status
class TaskNotFound(HTTPException):
def __init__(self):
super().__init__(
status_code=status.HTTP_404_NOT_FOUND,
detail="Task not found",
)
class DatabaseError(HTTPException):
def __init__(self, detail: str = "Database error occurred"):
super().__init__(
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
detail=detail,
)