1
0
mirror of synced 2024-06-05 05:47:49 +02: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: def remove_all(self) -> bool:
if self.lightweight_cleaning is True: if self.lightweight_cleaning is True:
try:
return self.__remove_all_lightweight() return self.__remove_all_lightweight()
except cairo.Error as e:
raise RuntimeError(e)
return self.__remove_all_thorough() return self.__remove_all_thorough()
def __remove_all_lightweight(self) -> bool: def __remove_all_lightweight(self) -> bool: