Skip to content

Commit

Permalink
if video is not found produce error
Browse files Browse the repository at this point in the history
  • Loading branch information
emdavis02 committed May 3, 2024
1 parent c6c0874 commit 461e78c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sleap_roots/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ def load(
# Attempt to load the video, with error handling
video = None
try:
video = sio.Video.from_filename(h5_path) if Path(h5_path).exists() else None
if not Path(h5_path).exists():
raise FileNotFoundError(f"File not found")
video = sio.Video.from_filename(h5_path)
except Exception as e:
print(f"Error loading video file {h5_path}: {e}")

Expand Down

0 comments on commit 461e78c

Please sign in to comment.