Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Report exceptions raised in document conversion
Browse files Browse the repository at this point in the history
Exceptions raised during the document conversion process would be
silently hidden. This was because ThreadPoolExecuter in logic.py created
various contexts and hid any exceptions raised.

Fixes #309
deeplow committed Jan 26, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 06fe53b commit af1f3ae
Showing 2 changed files with 7 additions and 1 deletion.
Empty file.
8 changes: 7 additions & 1 deletion dangerzone/isolation_provider/base.py
Original file line number Diff line number Diff line change
@@ -26,7 +26,13 @@ def convert(
stdout_callback: Optional[Callable] = None,
) -> None:
document.mark_as_converting()
success = self._convert(document, ocr_lang, stdout_callback)
try:
success = self._convert(document, ocr_lang, stdout_callback)
except Exception:
success = False
log.exception(
f"An exception occurred while converting document '{document.id}'"
)
if success:
document.mark_as_safe()
if document.archive_after_conversion:

0 comments on commit af1f3ae

Please sign in to comment.