Skip to content

Commit cef1bdb

Browse files
Merge pull request #228 from NeurodataWithoutBorders/better_fix_curl
More general curl fix
2 parents 67a2e29 + b787ce8 commit cef1bdb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

nwbinspector/utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,11 @@ def robust_s3_read(
126126
for retry in range(max_retries):
127127
try:
128128
return command(*command_args, **command_kwargs)
129-
except OSError: # cannot curl request
130-
sleep(0.1 * 2**retry)
131129
except Exception as exc:
132-
raise exc
130+
if "curl" in str(exc): # 'cannot curl request' can show up in potentially many different return error types
131+
sleep(0.1 * 2**retry)
132+
else:
133+
raise exc
133134
raise TimeoutError(f"Unable to complete the command ({command.__name__}) after {max_retries} attempts!")
134135

135136

0 commit comments

Comments
 (0)