Skip to content

Commit

Permalink
Catch exceptions while processing files
Browse files Browse the repository at this point in the history
  • Loading branch information
AliOsm committed Jul 24, 2024
1 parent 4020fa0 commit 015fe37
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tahweel/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ def main() -> None:
for pdf_file_path in tqdm(pdf_file_paths, desc='Files'):
pdf_file_manager = PdfFileManager(pdf_file_path, args.pdf2image_thread_count)

process_file(args, processor, pdf_file_manager)
try:
process_file(args, processor, pdf_file_manager)
except Exception:
print(f'Failed to process "{pdf_file_manager.file_path}", continuing...')
continue


def prepare_package_dirs() -> None:
Expand Down

0 comments on commit 015fe37

Please sign in to comment.