jack 1 month ago
parent
commit
dbe0c204f0
1 changed files with 10 additions and 6 deletions
  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"