Skip to content

Commit

Permalink
include original exception message in custom error
Browse files Browse the repository at this point in the history
  • Loading branch information
alyssadai committed Dec 4, 2024
1 parent fbd47ce commit 7d1a457
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bagel/utilities/pheno_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ def transform_age(value: str, heuristic: str) -> float:
is_recognized_heuristic = False
except (ValueError, isodate.isoerror.ISO8601Error) as e:
raise ValueError(
f"There was a problem with applying the age transformation: {heuristic}. "
"Check that the transformation specified in the data dictionary is correct for the age values in your phenotypic file, "
f"There was a problem with applying the age transformation: {heuristic}. Error: {str(e)}\n"
f"Check that the transformation specified in the data dictionary ({heuristic}) is correct for the age values in your phenotypic file, "
"and that you correctly annotated any missing values in your age column."
) from e
if not is_recognized_heuristic:
Expand Down

0 comments on commit 7d1a457

Please sign in to comment.