mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-29 10:12:38 +02:00
Report exceptions raised in document conversion
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
This commit is contained in:
parent
06fe53b0d6
commit
56b5b98f1e
1 changed files with 7 additions and 1 deletions
|
@ -26,7 +26,13 @@ class IsolationProvider(ABC):
|
|||
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:
|
||||
|
|
Loading…
Reference in a new issue