Skip to content

Commit

Permalink
Merge pull request #1336 from nipreps/fix/handle-webapi-timeout-errors
Browse files Browse the repository at this point in the history
ENH: Handle WebAPI timeouts more gently
  • Loading branch information
oesteban authored Aug 23, 2024
2 parents 73cd660 + 6f50852 commit 6c45860
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mriqc/interfaces/webapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,10 @@ def upload_qc_metrics(
timeout=15,
)
except requests.ConnectionError as err:
errmsg = f'QC metrics failed to upload due to connection error shown below:\n{err}'
errmsg = f'Error uploading IQMs -- Connection error:\n{err}'
return Bunch(status_code=1, text=errmsg)
except requests.exceptions.ReadTimeout as err:
errmsg = f'Error uploading IQMs -- {endpoint} seems down:\n{err}'
return Bunch(status_code=1, text=errmsg)

return response, data
Expand Down

0 comments on commit 6c45860

Please sign in to comment.