Skip to content

Commit 64a775b

Browse files
committed
🥅 Raise exception instead of warn + exit(1)
1 parent 494f0c7 commit 64a775b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

CPAC/_entrypoints/run.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -786,10 +786,9 @@ def run_main():
786786
# fillna
787787
bids_table["ses"] = bids_table["ses"].fillna("None")
788788
grouped_tab = bids_table.groupby(["sub", "ses"])
789-
except Exception as e: # TODO: raise exception
790-
WFLOGGER.warning("Could not create bids table: %s", e)
791-
print("Could not create bids table: %s", e)
792-
sys.exit(1)
789+
except Exception as e:
790+
msg = f"Could not create bids table: {e}"
791+
raise ValueError(msg) from e
793792
# else:
794793
# sub_list = load_cpac_data_config(
795794
# args.data_config_file, args.participant_label, args.aws_input_creds

0 commit comments

Comments
 (0)