From 2c4f5cfca2ce669043194c60f14d49034a06a2bf Mon Sep 17 00:00:00 2001 From: windsnow1025 Date: Sun, 13 Oct 2024 23:58:28 -0700 Subject: [PATCH] fix(fastapi): http exception --- fastapi/app/api/chat_router.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fastapi/app/api/chat_router.py b/fastapi/app/api/chat_router.py index 873b97e..e16ed47 100644 --- a/fastapi/app/api/chat_router.py +++ b/fastapi/app/api/chat_router.py @@ -37,6 +37,8 @@ async def generate(chat_request: ChatRequest, request: Request): temperature=chat_request.temperature, stream=chat_request.stream, ) + except HTTPException as e: + raise e except Exception as e: logging.exception(e) raise HTTPException(status_code=500, detail=str(e))