Skip to content

Commit

Permalink
improve error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Thinh Nguyen committed Sep 2, 2022
1 parent c33d1b0 commit f60ba3d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions element_array_ephys/readers/kilosort_triggering.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,11 @@ def _get_raw_data_filepaths(self):
data_directory = catGT_dest / run_folder / prb_folder
else:
data_directory = self._npx_input_dir

meta_fp = next(data_directory.glob(f'{session_str}*.ap.meta'))
bin_fp = next(data_directory.glob(f'{session_str}*.ap.bin'))
try:
meta_fp = next(data_directory.glob(f'{session_str}*.ap.meta'))
bin_fp = next(data_directory.glob(f'{session_str}*.ap.bin'))
except StopIteration:
raise RuntimeError(f'No ap meta/bin files found in {data_directory} - CatGT error?')

return meta_fp, bin_fp

Expand Down

0 comments on commit f60ba3d

Please sign in to comment.