From 0da324ce5e7566fce6ca41e0f79ec945d369f5d3 Mon Sep 17 00:00:00 2001 From: Eric Charles Date: Thu, 15 Jun 2023 21:43:03 -0700 Subject: [PATCH] raise ValueError for failed notebooks --- src/rail/cli/scripts.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/rail/cli/scripts.py b/src/rail/cli/scripts.py index fa62cff7..41c536a4 100644 --- a/src/rail/cli/scripts.py +++ b/src/rail/cli/scripts.py @@ -39,13 +39,14 @@ def render_nb(outdir, clear_output, dry_run, inputs, **kwargs): render = os.system(comline) status[nb_file] = render - ret_val = 0 + failed_notebooks = [] for key, val in status.items(): print(f"{key} {val}") if val != 0: - ret_val = val + failed_notebooks.append(key) - return ret_val + if failed_notebooks: + raise ValueError(f"The following notebooks failed {str(failed_notebooks)}") def clone_source(outdir, git_mode, dry_run, package_file):