From 9bbb07df91206d40bbcc069fdf4d07c83b816116 Mon Sep 17 00:00:00 2001 From: Roland Date: Fri, 23 Dec 2022 16:20:05 -0700 Subject: [PATCH] Handling if getting title causes an error. --- wrolpi/files/pdfs.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wrolpi/files/pdfs.py b/wrolpi/files/pdfs.py index 3633c067..e8be7c70 100644 --- a/wrolpi/files/pdfs.py +++ b/wrolpi/files/pdfs.py @@ -34,5 +34,8 @@ def pdf_modeler(groups: Dict[str, List[File]], _: Session): for file in pdf_files: path: pathlib.Path = file.path.path if hasattr(file.path, 'path') else file.path - if title := get_pdf_title(path): - file.title = title + try: + if title := get_pdf_title(path): + file.title = title + except Exception as e: + logger.error(f'Unable to get title of {file.path}', exc_info=e)