From 7f0997290165c913ac6843f11ece6bcf9a1c81a3 Mon Sep 17 00:00:00 2001 From: yangdx Date: Thu, 24 Apr 2025 15:46:25 +0800 Subject: [PATCH] Optimize error log --- lightrag/lightrag.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lightrag/lightrag.py b/lightrag/lightrag.py index 584d14b4..e6507c37 100644 --- a/lightrag/lightrag.py +++ b/lightrag/lightrag.py @@ -1114,9 +1114,11 @@ class LightRAG: llm_response_cache=self.llm_response_cache, ) except Exception as e: - logger.error( - f"Failed to extract entities and relationships : {traceback.format_exc()}" - ) + error_msg = f"Failed to extract entities and relationships: {str(e)}" + logger.error(error_msg) + async with pipeline_status_lock: + pipeline_status["latest_message"] = error_msg + pipeline_status["history_messages"].append(error_msg) raise e async def _insert_done(