Files
db-middleware/core/exceptions.py

20 lines
447 B
Python

from fastapi import HTTPException
class ObjectNotFoundInDB(Exception):
def __init__(self, *args):
super().__init__(*args)
class UserNotFound(HTTPException):
def __init__(
self,
status_code=404,
detail={
"message": "Didn't find a user with the provided id.",
"code": "user-not-found",
},
headers=None,
):
super().__init__(status_code, detail, headers)