Skip to content

Commit

Permalink
fix: openai issue
Browse files Browse the repository at this point in the history
  • Loading branch information
tjbck committed Mar 16, 2024
1 parent f90236f commit 1e03871
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions backend/apps/openai/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ async def speech(request: Request, user=Depends(get_verified_user)):
except:
error_detail = f"External: {e}"

raise HTTPException(status_code=r.status_code, detail=error_detail)
raise HTTPException(
status_code=r.status_code if r else 500, detail=error_detail
)

except ValueError:
raise HTTPException(status_code=401, detail=ERROR_MESSAGES.OPENAI_NOT_FOUND)
Expand Down Expand Up @@ -328,4 +330,6 @@ async def proxy(path: str, request: Request, user=Depends(get_verified_user)):
except:
error_detail = f"External: {e}"

raise HTTPException(status_code=r.status_code, detail=error_detail)
raise HTTPException(
status_code=r.status_code if r else 500, detail=error_detail
)

0 comments on commit 1e03871

Please sign in to comment.