diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/apis.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/apis.py b/app/apis.py index 4c6c3fe..f50d403 100644 --- a/app/apis.py +++ b/app/apis.py @@ -1,6 +1,6 @@ from api import app from app import models -from fastapi import Body, FastAPI +from fastapi import Body, FastAPI, HTTPException from fastapi.middleware.wsgi import WSGIMiddleware from pydantic import BaseModel @@ -14,7 +14,7 @@ async def API_User_Details(email: str): try: assert user != None except AssertionError: - return {"message": "User Not Found"} + raise HTTPException(status_code=404, detail="User Not Found") return { "first_name":user.first_name, "last_name":user.last_name}
\ No newline at end of file |