Skip to content

Commit 70644d6

Browse files
Update nwbinspector.py
1 parent 55ddf2f commit 70644d6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

nwbinspector/nwbinspector.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ def inspect_nwb(
459459
filterwarnings(action="ignore", message="No cached namespaces found in .*")
460460
filterwarnings(action="ignore", message="Ignoring cached namespace .*")
461461

462-
def _collect_all_messages(nwbfile_path: FilePathType, driver: Optional[str] = None, skip_validate: bool = False):
462+
def _collect_all_messages(nwbfile_path: FilePathType, checks: list, driver: Optional[str] = None, skip_validate: bool = False):
463463
with pynwb.NWBHDF5IO(path=nwbfile_path, mode="r", load_namespaces=True, driver=driver) as io:
464464
if not skip_validate:
465465
validation_errors = pynwb.validate(io=io)
@@ -477,6 +477,8 @@ def _collect_all_messages(nwbfile_path: FilePathType, driver: Optional[str] = No
477477
for inspector_message in run_checks(nwbfile=nwbfile, checks=checks):
478478
inspector_message.file_path = nwbfile_path
479479
yield inspector_message
480+
except OSError as ex:
481+
raise ex # propagate outside private
480482
except Exception as ex:
481483
yield InspectorMessage(
482484
message=traceback.format_exc(),
@@ -486,14 +488,14 @@ def _collect_all_messages(nwbfile_path: FilePathType, driver: Optional[str] = No
486488
)
487489

488490
if driver != "ros3":
489-
yield _collect_all_messages(nwbfile_path=nwbfile_path, driver=driver, skip_validate=skip_validate)
491+
yield _collect_all_messages(nwbfile_path=nwbfile_path, checks=checks, driver=driver, skip_validate=skip_validate)
490492
else:
491493
retries = 0
492494

493495
while retries < max_retries:
494496
try:
495497
retries += 1
496-
yield _collect_all_messages(nwbfile_path=nwbfile_path, driver=driver, skip_validate=skip_validate)
498+
yield _collect_all_messages(nwbfile_path=nwbfile_path, checks=checks, driver=driver, skip_validate=skip_validate)
497499
except OSError: # Cannot curl request
498500
sleep(0.1 * 2 ** retries)
499501

0 commit comments

Comments
 (0)