From 5e00ef9bbf00fcc3b5823048c7e4aad8945dd374 Mon Sep 17 00:00:00 2001 From: Siddharth Patel <36140839+sid4py@users.noreply.github.com> Date: Thu, 7 Nov 2024 13:17:47 -0500 Subject: [PATCH] capture exception before raising IndicatorColumnError --- neurobooth_terra/redcap.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/neurobooth_terra/redcap.py b/neurobooth_terra/redcap.py index 3d54daa..4aade4e 100755 --- a/neurobooth_terra/redcap.py +++ b/neurobooth_terra/redcap.py @@ -356,8 +356,8 @@ def dataframe_to_tuple(df, df_columns, fixed_columns=None, try: if col.startswith(indicator_column+'___'): mapping[col] = col.split('___')[1] - except: - raise IndicatorColumnError('Could not split column: {col} for indicator column: {indicator_column}') + except Exception as e: + raise IndicatorColumnError('Could not split column: {col} for indicator column: {indicator_column}') from e if len(mapping) == 0: error_text = f'Please confirm that the combine-checkbox-option-into-single-column' \ 'under Redcap survey is unchecked.\n'