mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-30 18:52:38 +02:00
qubes: Display all errors in second stage
If a command encounters an error or times out during the second stage of the conversion in Qubes, handle it the same way as we would have handled it in the first stage: 1. Get its error message. 2. Throw an UnexpectedConversionError exception, with the original message. Note that, because the second stage takes place locally, users will see the original content of the error. Refs #567 Closes #430
This commit is contained in:
parent
2016965c84
commit
16603875d6
1 changed files with 5 additions and 3 deletions
|
@ -162,9 +162,11 @@ class Qubes(IsolationProvider):
|
|||
def print_progress_wrapper(error: bool, text: str, percentage: float) -> None:
|
||||
self.print_progress_trusted(document, error, text, percentage)
|
||||
|
||||
asyncio.run(
|
||||
PixelsToPDF(progress_callback=print_progress_wrapper).convert(ocr_lang)
|
||||
)
|
||||
converter = PixelsToPDF(progress_callback=print_progress_wrapper)
|
||||
try:
|
||||
asyncio.run(converter.convert(ocr_lang))
|
||||
except (RuntimeError, TimeoutError, ValueError) as e:
|
||||
raise errors.UnexpectedConversionError(str(e))
|
||||
|
||||
shutil.move(CONVERTED_FILE_PATH, document.output_filename)
|
||||
success = True
|
||||
|
|
Loading…
Reference in a new issue