Skip to content

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

fix: add exception handling for get_by_id method (#6861)

caiming100a20439bf8122
diff --git a/api/db/services/common_service.py b/api/db/services/common_service.py
index 75bc1a6f47..cf31a2a62c 100644
--- a/api/db/services/common_service.py
+++ b/api/db/services/common_service.py
@@ -225,9 +225,12 @@ class CommonService:
# pid: Record ID
# Returns:
# Tuple of (success, record)
- obj = cls.model.get_or_none(cls.model.id == pid)
- if obj:
- return True, obj
+ try:
+ obj = cls.model.get_or_none(cls.model.id == pid)
+ if obj:
+ return True, obj
+ except Exception:
+ pass
return False, None
@classmethod