🐛 fix(chat.py): add exception logging to stream_build function to improve error handling
The `stream_build` function now logs the exception that occurred during the flow building process using the `logger.exception` method. This improves error handling and provides more detailed information about the error in the logs.
This commit is contained in:
parent
766ef28a0c
commit
9a69a71ea1
1 changed files with 1 additions and 0 deletions
|
|
@ -139,6 +139,7 @@ async def stream_build(flow_id: str):
|
||||||
# We need to reset the chat history
|
# We need to reset the chat history
|
||||||
chat_manager.chat_history.empty_history(flow_id)
|
chat_manager.chat_history.empty_history(flow_id)
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
|
logger.exception(exc)
|
||||||
logger.error("Error while building the flow: %s", exc)
|
logger.error("Error while building the flow: %s", exc)
|
||||||
yield str(StreamData(event="error", data={"error": str(exc)}))
|
yield str(StreamData(event="error", data={"error": str(exc)}))
|
||||||
finally:
|
finally:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue