mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 19:24:27 +00:00
(fix) proxy server - raise 500 on exceptions
This commit is contained in:
parent
6b981a829c
commit
259f4b977a
1 changed files with 2 additions and 2 deletions
|
@ -493,7 +493,7 @@ async def completion(request: Request, model: Optional[str] = None):
|
||||||
try:
|
try:
|
||||||
status = e.status_code # type: ignore
|
status = e.status_code # type: ignore
|
||||||
except:
|
except:
|
||||||
status = status.HTTP_500_INTERNAL_SERVER_ERROR,
|
status = 500
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=status,
|
status_code=status,
|
||||||
detail=error_msg
|
detail=error_msg
|
||||||
|
@ -529,7 +529,7 @@ async def chat_completion(request: Request, model: Optional[str] = None):
|
||||||
try:
|
try:
|
||||||
status = e.status_code # type: ignore
|
status = e.status_code # type: ignore
|
||||||
except:
|
except:
|
||||||
status = status.HTTP_500_INTERNAL_SERVER_ERROR,
|
status = 500
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=status,
|
status_code=status,
|
||||||
detail=error_msg
|
detail=error_msg
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue