Handling if getting title causes an error.

This commit is contained in:
Roland 2022-12-23 16:20:05 -07:00
parent 7fef847d3a
commit 9bbb07df91
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93

View file

@ -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)