mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-29 10:12:38 +02:00
Do not show file previews in case of exceptions
If a Qubes conversion encounters an exception that is not a subclass of ConversionException, it will still show a preview of a file that does not exist. Send an error progress report in that case, so that the GUI code can detect that an error occurred and not open a file preview Fixes #581
This commit is contained in:
parent
bdf3f8babc
commit
3daf0e2cb7
1 changed files with 2 additions and 1 deletions
|
@ -39,12 +39,13 @@ class IsolationProvider(ABC):
|
||||||
success = self._convert(document, ocr_lang)
|
success = self._convert(document, ocr_lang)
|
||||||
except ConversionException as e:
|
except ConversionException as e:
|
||||||
success = False
|
success = False
|
||||||
self.print_progress_trusted(document, True, e.error_message, 0)
|
self.print_progress_trusted(document, True, str(e), 0)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
success = False
|
success = False
|
||||||
log.exception(
|
log.exception(
|
||||||
f"An exception occurred while converting document '{document.id}'"
|
f"An exception occurred while converting document '{document.id}'"
|
||||||
)
|
)
|
||||||
|
self.print_progress_trusted(document, True, str(e), 0)
|
||||||
if success:
|
if success:
|
||||||
document.mark_as_safe()
|
document.mark_as_safe()
|
||||||
if document.archive_after_conversion:
|
if document.archive_after_conversion:
|
||||||
|
|
Loading…
Reference in a new issue