From 7fc54d52e4e46addf6b806cbbc1105660d8dd2cd Mon Sep 17 00:00:00 2001 From: trducng Date: Tue, 6 Feb 2024 12:21:12 +0700 Subject: [PATCH] Improve ocr loader error message --- libs/kotaemon/kotaemon/loaders/utils/pdf_ocr.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/kotaemon/kotaemon/loaders/utils/pdf_ocr.py b/libs/kotaemon/kotaemon/loaders/utils/pdf_ocr.py index 197e021..d7b7e04 100644 --- a/libs/kotaemon/kotaemon/loaders/utils/pdf_ocr.py +++ b/libs/kotaemon/kotaemon/loaders/utils/pdf_ocr.py @@ -32,9 +32,10 @@ def read_pdf_unstructured(input_path: Union[Path, str]): """ try: from unstructured.partition.auto import partition - except ImportError: + except ImportError as e: raise ImportError( - "Please install unstructured PDF reader `pip install unstructured[pdf]`" + "Please install unstructured PDF reader `pip install unstructured[pdf]`: " + f"{e}" ) page_items = defaultdict(list)