From 65ab15b5ce8fa8200ca824cb3c454d1d8fcd2971 Mon Sep 17 00:00:00 2001 From: Matt Tancik Date: Wed, 14 Sep 2022 08:59:10 -0700 Subject: [PATCH] Update error handling in data processing script --- scripts/process_data.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/process_data.py b/scripts/process_data.py index a080a548c..d606de522 100755 --- a/scripts/process_data.py +++ b/scripts/process_data.py @@ -78,9 +78,12 @@ def run_command(cmd, verbose=False) -> Optional[str]: Returns: The output of the command if return_output is True, otherwise None. """ - out = subprocess.run(cmd, capture_output=not verbose, shell=True, check=True) + out = subprocess.run(cmd, capture_output=not verbose, shell=True, check=False) if out.returncode != 0: + CONSOLE.rule("[bold red] :skull: :skull: :skull: ERROR :skull: :skull: :skull: ", style="red") CONSOLE.print(f"[bold red]Error running command: {cmd}") + CONSOLE.rule(style="red") + CONSOLE.print(out.stderr.decode("utf-8")) sys.exit(1) if out.stdout is not None: return out.stdout.decode("utf-8")