diff options
| author | jvoisin | 2023-09-07 16:31:34 +0200 |
|---|---|---|
| committer | jvoisin | 2023-09-07 16:31:34 +0200 |
| commit | abcdf07ef446310e67285b0c1eef633b53e21dbd (patch) | |
| tree | b585d89851d3672482797cfba33b2e6ac32e409d /libmat2/pdf.py | |
| parent | a3081bce47bc475a7afaa25e834e8afe399dc350 (diff) | |
Properly handle a cairo exception
Diffstat (limited to '')
| -rw-r--r-- | libmat2/pdf.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libmat2/pdf.py b/libmat2/pdf.py index 8c3055f..ca94067 100644 --- a/libmat2/pdf.py +++ b/libmat2/pdf.py | |||
| @@ -36,7 +36,10 @@ class PDFParser(abstract.AbstractParser): | |||
| 36 | 36 | ||
| 37 | def remove_all(self) -> bool: | 37 | def remove_all(self) -> bool: |
| 38 | if self.lightweight_cleaning is True: | 38 | if self.lightweight_cleaning is True: |
| 39 | return self.__remove_all_lightweight() | 39 | try: |
| 40 | return self.__remove_all_lightweight() | ||
| 41 | except cairo.Error as e: | ||
| 42 | raise RuntimeError(e) | ||
| 40 | return self.__remove_all_thorough() | 43 | return self.__remove_all_thorough() |
| 41 | 44 | ||
| 42 | def __remove_all_lightweight(self) -> bool: | 45 | def __remove_all_lightweight(self) -> bool: |
