1
0
Fork 0

Properly handle a cairo exception

This commit is contained in:
jvoisin 2023-09-07 16:31:34 +02:00
parent a3081bce47
commit abcdf07ef4
1 changed files with 4 additions and 1 deletions

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: