1
0
mirror of synced 2024-11-24 02:04:23 +01:00

Properly handle a cairo exception

This commit is contained in:
jvoisin 2023-09-07 16:31:34 +02:00
parent a3081bce47
commit abcdf07ef4

View File

@ -36,7 +36,10 @@ class PDFParser(abstract.AbstractParser):
def remove_all(self) -> bool:
if self.lightweight_cleaning is True:
return self.__remove_all_lightweight()
try:
return self.__remove_all_lightweight()
except cairo.Error as e:
raise RuntimeError(e)
return self.__remove_all_thorough()
def __remove_all_lightweight(self) -> bool: