Skip to content

Commit f60ba3d

Browse files
author
Thinh Nguyen
committed
improve error handling
1 parent c33d1b0 commit f60ba3d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

element_array_ephys/readers/kilosort_triggering.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,11 @@ def _get_raw_data_filepaths(self):
239239
data_directory = catGT_dest / run_folder / prb_folder
240240
else:
241241
data_directory = self._npx_input_dir
242-
243-
meta_fp = next(data_directory.glob(f'{session_str}*.ap.meta'))
244-
bin_fp = next(data_directory.glob(f'{session_str}*.ap.bin'))
242+
try:
243+
meta_fp = next(data_directory.glob(f'{session_str}*.ap.meta'))
244+
bin_fp = next(data_directory.glob(f'{session_str}*.ap.bin'))
245+
except StopIteration:
246+
raise RuntimeError(f'No ap meta/bin files found in {data_directory} - CatGT error?')
245247

246248
return meta_fp, bin_fp
247249

0 commit comments

Comments
 (0)