Created basic backend structure, auth and CRUD endpoints.
This commit is contained in:
19
core/exceptions.py
Normal file
19
core/exceptions.py
Normal file
@@ -0,0 +1,19 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user