mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 16:43:16 +00:00
feat: Improve error handling in /stream route
This commit is contained in:
@@ -198,7 +198,8 @@ def complete_stream(question, retriever, conversation_id, user_api_key):
|
||||
data = json.dumps({"type": "end"})
|
||||
yield f"data: {data}\n\n"
|
||||
except Exception as e:
|
||||
data = json.dumps({"type": "error","error": str(e)})
|
||||
data = json.dumps({"type": "error","error":"Please try again later. We apologize for any inconvenience.",
|
||||
"error_exception": str(e)})
|
||||
yield f"data: {data}\n\n"
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user