Catch import errors seperately to raise errors about missing dependencies.
This commit is contained in:
parent
5cd951a5f3
commit
be2d8ea8f4
1 changed files with 2 additions and 0 deletions
|
|
@ -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}")
|
||||
|
|
|
|||
Loading…
Reference in a new issue