File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99from jinja2 import Template
1010
1111from .common import combine_pdfs , compress_pdf , convert_svg_to_pdf , deep_merge
12- from .errors import PDFBakeError , PDFCompressionError , SVGConversionError
12+ from .errors import (
13+ PDFBakeError ,
14+ PDFCombineError ,
15+ PDFCompressionError ,
16+ SVGConversionError ,
17+ )
1318from .render import create_env , prepare_template_context
1419
1520__all__ = [
@@ -204,10 +209,13 @@ def _process_with_custom_bake(self, bake_path: Path) -> None:
204209
205210 def _finalize (self , pdf_files : list [Path ], config : dict [str , Any ]) -> None :
206211 """Combine pages and handle compression."""
207- combined_pdf = combine_pdfs (
208- pdf_files ,
209- self .build_dir / f"{ config ['filename' ]} .pdf" ,
210- )
212+ try :
213+ combined_pdf = combine_pdfs (
214+ pdf_files ,
215+ self .build_dir / f"{ config ['filename' ]} .pdf" ,
216+ )
217+ except PDFCombineError as exc :
218+ raise PDFBakeError (f"Failed to combine PDFs: { exc } " ) from exc
211219
212220 output_path = self .dist_dir / f"{ config ['filename' ]} .pdf"
213221
You can’t perform that action at this time.
0 commit comments