From: Don Armstrong Date: Fri, 24 Feb 2023 00:32:02 +0000 (-0800) Subject: add input/output files when reporting error message X-Git-Url: https://git.donarmstrong.com/?p=scanner_workflow.git;a=commitdiff_plain;h=5e6fee0407e43d09cc77c870a3bc1c3d0442469a add input/output files when reporting error message --- diff --git a/scanner_workflow.py b/scanner_workflow.py index e803f9e..787e34e 100755 --- a/scanner_workflow.py +++ b/scanner_workflow.py @@ -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}")