Skip to content

Commit

Permalink
Merge branch 'master' into fix/handle-nan-iqms
Browse files Browse the repository at this point in the history
  • Loading branch information
oesteban authored Aug 23, 2024
2 parents a60a26f + 6c45860 commit 0e486ab
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mriqc/interfaces/webapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ def upload_qc_metrics(
start_message = messages.QC_UPLOAD_START.format(url=endpoint)
config.loggers.interface.info(start_message)

errmsg = None
try:
# if the modality is bold, call "bold" endpoint
response = requests.post(
Expand All @@ -289,8 +290,12 @@ 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}'
return Bunch(status_code=1, text=errmsg), data
errmsg = (f'Error uploading IQMs: Connection error:', f'{err}')
except requests.exceptions.ReadTimeout as err:
errmsg = (f'Error uploading IQMs: Server {endpoint} is down.', f'{err}')

if errmsg is not None:
response = Bunch(status_code=1, text='\n'.join(errmsg))

return response, data

Expand Down

0 comments on commit 0e486ab

Please sign in to comment.