diff --git a/element_array_ephys/readers/kilosort_triggering.py b/element_array_ephys/readers/kilosort_triggering.py index 3645dc1a..4bdd1fed 100644 --- a/element_array_ephys/readers/kilosort_triggering.py +++ b/element_array_ephys/readers/kilosort_triggering.py @@ -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