🐛 fix(chat.py): handle and log any exception that occurs in the chat websocket to prevent unhandled errors and provide better error messages
This commit is contained in:
parent
163a7c49cd
commit
9d7deccc53
1 changed files with 3 additions and 0 deletions
|
|
@ -59,6 +59,9 @@ async def chat(
|
|||
except WebSocketException as exc:
|
||||
logger.error(f"Websocket error: {exc}")
|
||||
await websocket.close(code=status.WS_1011_INTERNAL_ERROR, reason=str(exc))
|
||||
except Exception as exc:
|
||||
logger.error(f"Error in chat websocket: {exc}")
|
||||
await websocket.close(code=status.WS_1011_INTERNAL_ERROR, reason=str(exc))
|
||||
|
||||
|
||||
@router.post("/build/init/{flow_id}", response_model=InitResponse, status_code=201)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue