fix: handle non text uploads more carefully

This commit is contained in:
Alex committed 2026-09-14 17:27:13 +01:00
1 parent 82691314ca
commit 3030aba39d
21 files changed
+729 -40

No files matched your search

+2 -1
View File
@@ -23,6 +23,7 @@ from docsgpt.core.settings import settings
from docsgpt.parser.file.base_parser import (
BaseParser,
DocumentParseError,
NoTextLayerError,
delegate_parse,
module_available,
)
@@ -424,7 +425,7 @@ class AnydocParser(BaseParser):
"tesseract binary or a DeepSeek-OCR endpoint (OCR_ENGINE), or "
"through the optional docling extra when installed."
)
raise DocumentParseError(
raise NoTextLayerError(
f"{path.name} appears to be a scanned PDF (no text layer), and "
f"{type(fallback).__name__} extracted almost nothing{hint}"
)