Skip to content

Commit 6562adf

Browse files
committed
Handle "gs not found" specifically with own error message
1 parent 0a74d99 commit 6562adf

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/pdfbaker/pdf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ def compress_pdf(
152152
]
153153
)
154154
return output_pdf
155+
except FileNotFoundError as exc:
156+
raise PDFCompressionError(f"Ghostscript not found: {exc}") from exc
155157
except subprocess.SubprocessError as exc:
156158
raise PDFCompressionError(f"Ghostscript compression failed: {exc}") from exc
157159

0 commit comments

Comments
 (0)