Skip to content

Commit

Permalink
fix(documentation): exit with error code if PDF generation fails
Browse files Browse the repository at this point in the history
  • Loading branch information
urish committed May 29, 2024
1 parent 17e0894 commit 11b2d37
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion documentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ def write_datasheet(self, markdown_file: str, pdf_file: Optional[str] = None):
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")
Expand Down
3 changes: 2 additions & 1 deletion project.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,8 @@ def create_pdf(self):
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):
Expand Down

0 comments on commit 11b2d37

Please sign in to comment.