Skip to content

Commit

Permalink
Add exception handling for failed data loading
Browse files Browse the repository at this point in the history
  • Loading branch information
magland committed Aug 13, 2024
1 parent 32ed84b commit 1c495e5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lindi/LindiH5pyFile/LindiReferenceFileSystemStore.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ def _read_bytes_from_url_or_path(url_or_path: str, offset: int, length: int):
delay = 0.1 * 2 ** try_num
print(f'Retry load data from {url_or_path} in {delay} seconds')
time.sleep(delay)
raise Exception(f"Failed to load data from {url_or_path}")
else:
with open(url_or_path, 'rb') as f:
f.seek(offset)
Expand Down

0 comments on commit 1c495e5

Please sign in to comment.