From f3ac628fd4e9ddb36f48c23186488bcef55f5e48 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Thu, 6 Oct 2022 17:06:22 +0300 Subject: DEBUG: Collect more information on possible failure. --- gn3/computations/rust_correlation.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gn3/computations/rust_correlation.py b/gn3/computations/rust_correlation.py index 03af997..016f00e 100644 --- a/gn3/computations/rust_correlation.py +++ b/gn3/computations/rust_correlation.py @@ -59,7 +59,14 @@ def run_correlation( tmp_dir=tmp_dir, tmp_file=tmp_file, method=method, delimiter=delimiter, x_vals=trait_vals) command_list = [CORRELATION_COMMAND, json_file, TMPDIR] - subprocess.run(command_list, check=True) + try: + subprocess.run(command_list, check=True, capture_output=True) + except subprocess.CalledProcessError as cpe: + actual_command = ( + os.readlink(CORRELATION_COMMAND) + if os.path.islink(CORRELATION_COMMAND) + else CORRELATION_COMMAND) + raise Exception(command_list, actual_command, cpe.stdout, cpe) return parse_correlation_output(output_file, corr_type, top_n) -- cgit v1.2.3