mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-28 18:02:38 +02:00
Handle gracefully unknown error codes
Do not throw exceptions for unknown error codes. If `get_proc_exception()` gets called from within an exception context and raises an exception itself, then this exception will not get caught, and it will get lost. Prefer instead to return an exception class that we have for this purpose, and show to the user the unknown error code of the converesion process.
This commit is contained in:
parent
aeb8c33b6e
commit
e73f10f99b
1 changed files with 1 additions and 1 deletions
|
@ -106,4 +106,4 @@ def exception_from_error_code(
|
|||
for cls in ConversionException.get_subclasses():
|
||||
if cls.error_code == error_code:
|
||||
return cls()
|
||||
raise ValueError(f"Unknown error code '{error_code}'")
|
||||
return UnexpectedConversionError(f"Unknown error code '{error_code}'")
|
||||
|
|
Loading…
Reference in a new issue