Skip to content

Commit 6c45860

Browse files
authored
Merge pull request #1336 from nipreps/fix/handle-webapi-timeout-errors
ENH: Handle WebAPI timeouts more gently
2 parents 73cd660 + 6f50852 commit 6c45860

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

mriqc/interfaces/webapi.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,10 @@ def upload_qc_metrics(
276276
timeout=15,
277277
)
278278
except requests.ConnectionError as err:
279-
errmsg = f'QC metrics failed to upload due to connection error shown below:\n{err}'
279+
errmsg = f'Error uploading IQMs -- Connection error:\n{err}'
280+
return Bunch(status_code=1, text=errmsg)
281+
except requests.exceptions.ReadTimeout as err:
282+
errmsg = f'Error uploading IQMs -- {endpoint} seems down:\n{err}'
280283
return Bunch(status_code=1, text=errmsg)
281284

282285
return response, data

0 commit comments

Comments
 (0)