Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

fix: replace traceback.print_exc() with logging.exception(e) in conve… (#10275)

buua436aaa97874c6bd
diff --git a/api/apps/conversation_app.py b/api/apps/conversation_app.py
index 36543d4e29..48b9a15681 100644
--- a/api/apps/conversation_app.py
+++ b/api/apps/conversation_app.py
@@ -15,7 +15,7 @@
#
import json
import re
-import traceback
+import logging
from copy import deepcopy
from flask import Response, request
from flask_login import current_user, login_required
@@ -226,7 +226,7 @@ def completion():
if not is_embedded:
ConversationService.update_by_id(conv.id, conv.to_dict())
except Exception as e:
- traceback.print_exc()
+ logging.exception(e)
yield "data:" + json.dumps({"code": 500, "message": str(e), "data": {"answer": "**ERROR**: " + str(e), "reference": []}}, ensure_ascii=False) + "\n\n"
yield "data:" + json.dumps({"code": 0, "message": "", "data": True}, ensure_ascii=False) + "\n\n"