Skip to content

Commit a1ab9ec

Browse files
committed
Exception -> ValueError
1 parent 78ef8ea commit a1ab9ec

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

neo/rawio/openephysrawio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def _parse_header(self):
117117
# check for continuity (no gaps)
118118
diff = np.diff(data_chan['timestamp'])
119119
if not np.all(diff == RECORD_SIZE) and not self._ignore_timestamps_errors:
120-
raise Exception(
120+
raise ValueError(
121121
'Not continuous timestamps for {}. ' \
122122
'Maybe because recording was paused/stopped.'.format(continuous_filename)
123123
)

neo/test/rawiotest/test_openephysrawio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def test_raise_error_if_discontinuous_files(self):
2020
# It must raise an error
2121
reader = OpenEphysRawIO(dirname=self.get_local_path(
2222
'openephys/OpenEphys_SampleData_2_(multiple_starts)'))
23-
with self.assertRaises(Exception):
23+
with self.assertRaises(ValueError):
2424
reader.parse_header()
2525
# if ignore_timestamps_errors=True, no exception is raised
2626
reader = OpenEphysRawIO(dirname=self.get_local_path(

0 commit comments

Comments
 (0)