From 9b40a9d8cb66c4648cfa3f42bf7c3937cf3ba199 Mon Sep 17 00:00:00 2001 From: Patrick Sadil Date: Wed, 16 Oct 2024 18:34:03 -0400 Subject: [PATCH] Improve exception Co-authored-by: Chris Markiewicz --- sdcflows/utils/epimanip.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sdcflows/utils/epimanip.py b/sdcflows/utils/epimanip.py index 836f327b9e..4461f10a5d 100644 --- a/sdcflows/utils/epimanip.py +++ b/sdcflows/utils/epimanip.py @@ -189,9 +189,8 @@ def get_trt(in_meta, in_file=None): return trt elif in_file is None: - msg = "Unable to find TotalReadoutTime in metadata and in_file \ - not defined." - raise AssertionError(msg) + msg = "`in_file` must be defined if TotalReadoutTime does not appear in `in_meta`." + raise ValueError(msg) # npe = N voxels PE direction pe_index = "ijk".index(in_meta["PhaseEncodingDirection"][0])