Catch import errors seperately to raise errors about missing dependencies.

This commit is contained in:
Yiorgis Gozadinos 2025-11-05 10:13:58 +02:00
parent 5cd951a5f3
commit be2d8ea8f4
No known key found for this signature in database

View file

@ -126,5 +126,7 @@ class FileReader:
# Fallback: try to read as text and convert to DoclingDocument
content = path.read_text(encoding="utf-8")
return text_to_docling_document(content, name=f"{path.stem}.md")
except ImportError:
raise
except Exception:
raise ValueError(f"Failed to parse file: {path}")