better exception logging

This commit is contained in:
jonaswinkler
2021-03-22 23:00:15 +01:00
parent 62f829ae82
commit d85a0f950f
2 changed files with 13 additions and 9 deletions

View File

@@ -246,9 +246,9 @@ class RasterisedDocumentParser(DocumentParser):
if original_has_text:
self.text = text_original
except (NoTextFoundException, InputFileError) as e:
self.log("exception",
f"Encountered the following error while running OCR, "
f"attempting force OCR to get the text.")
self.log("warning",
f"Encountered an error while running OCR: {str(e)}. "
f"Attempting force OCR to get the text.")
archive_path_fallback = os.path.join(
self.tempdir, "archive-fallback.pdf")