From 11b2d371b4e53a1ee15c2ca1b0f817aa871e034a Mon Sep 17 00:00:00 2001 From: Uri Shaked Date: Wed, 29 May 2024 17:02:39 +0300 Subject: [PATCH] fix(documentation): exit with error code if PDF generation fails --- documentation.py | 3 ++- project.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/documentation.py b/documentation.py index 6bccad1..7d5daa5 100644 --- a/documentation.py +++ b/documentation.py @@ -159,7 +159,8 @@ class Docs: logging.info(pdf_cmd) p = subprocess.run(pdf_cmd, shell=True) if p.returncode != 0: - logging.error("pdf command failed") + logging.error("pdf generation failed") + raise RuntimeError(f"pdf generation failed with code {p.returncode}") def build_hugo_content(self, hugo_root: str) -> None: hugo_images = os.path.join(hugo_root, "images") diff --git a/project.py b/project.py index 0b9ece1..fc5ff2d 100644 --- a/project.py +++ b/project.py @@ -640,7 +640,8 @@ class Project: logging.info(pdf_cmd) p = subprocess.run(pdf_cmd, shell=True) if p.returncode != 0: - logging.error("pdf command failed") + logging.error("pdf generation failed") + raise RuntimeError(f"pdf generation failed with code {p.returncode}") # Read and return top-level GDS data from the final GDS file, using gdstk: def get_final_gds_top_cells(self):