jack 1 月之前
父节点
当前提交
dbe0c204f0
共有 1 个文件被更改,包括 10 次插入6 次删除
  1. 10 6
      py/core/providers/ingestion/unstructured/base.py

+ 10 - 6
py/core/providers/ingestion/unstructured/base.py

@@ -340,12 +340,16 @@ class UnstructuredIngestionProvider(IngestionProvider):
             logger.info(
                 f"Parsing {document.document_type}: {document.id} with fallback parser"
             )
-            async for element in self.parse_fallback(
-                file_content,
-                ingestion_config=ingestion_config,
-                parser_name=document.document_type,
-            ):
-                elements.append(element)
+            try:
+                async for element in self.parse_fallback(
+                    file_content,
+                    ingestion_config=ingestion_config,
+                    parser_name=document.document_type,
+                ):
+                    elements.append(element)
+            except Exception as e:
+                logger.error(f"Error parsing {document.document_type}: {e}")
+                raise e
         else:
             logger.info(
                 f"Parsing {document.document_type}: {document.id} with unstructured"