]> git.donarmstrong.com Git - scanner_workflow.git/commitdiff
add input/output files when reporting error message
authorDon Armstrong <don@donarmstrong.com>
Fri, 24 Feb 2023 00:32:02 +0000 (16:32 -0800)
committerDon Armstrong <don@donarmstrong.com>
Fri, 24 Feb 2023 00:32:02 +0000 (16:32 -0800)
scanner_workflow.py

index e803f9ee1fa4da4e6f5df62922e0328df6d72011..787e34e593559320f774d925a4438eb3a589d398 100755 (executable)
@@ -107,7 +107,9 @@ class ScannerWorkflow:
         output_file = self.output_dir / output_path / pdf_file.name
         res = subprocess.run(["ocrmypdf", *self.ocrmypdf_opts, pdf_file, output_file])
         if res.returncode != 0:
-            error(f"Unable to properly OCR pdf: {res.stdout} {res.stderr}")
+            error(
+                f"Unable to properly OCR pdf {orig_pdf} into {output_file}: {res.stdout} {res.stderr}"
+            )
             return
         pdf_file.unlink()
         info(f"Processed {orig_pdf} into {output_file}")