diff options
author | Frederick Muriuki Muriithi | 2024-07-01 14:59:32 -0500 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2024-07-01 14:59:32 -0500 |
commit | a68fe177ae41f2e58a64b3f8dcf3f825d004eeca (patch) | |
tree | 076b90e1ff1b3efa9ffd2b42588fef24c6ce88ea /qc_app/templates/rqtl2/upload-rqtl2-bundle-step-01.html | |
parent | f0434c14b1359f8decf712926e502bd98822b38c (diff) | |
download | gn-uploader-a68fe177ae41f2e58a64b3f8dcf3f825d004eeca.tar.gz |
Respond with JSON. Handle error messages on UI.
Diffstat (limited to 'qc_app/templates/rqtl2/upload-rqtl2-bundle-step-01.html')
-rw-r--r-- | qc_app/templates/rqtl2/upload-rqtl2-bundle-step-01.html | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/qc_app/templates/rqtl2/upload-rqtl2-bundle-step-01.html b/qc_app/templates/rqtl2/upload-rqtl2-bundle-step-01.html index c6c79e5..07c240f 100644 --- a/qc_app/templates/rqtl2/upload-rqtl2-bundle-step-01.html +++ b/qc_app/templates/rqtl2/upload-rqtl2-bundle-step-01.html @@ -240,6 +240,21 @@ window.location.replace(uri); } }); + + r.on("error", (message, file) => { + filename = (file.webkitRelativePath + || file.relativePath + || file.fileName + || file.name); + jsonmsg = JSON.parse(message); + alert("There was an error while uploading your file '" + + filename + + "'. The error message was:\n\n\t" + + jsonmsg.error + + " (" + + jsonmsg.statuscode + + "): " + jsonmsg.message); + }) } else { setup_upload_handlers( "frm-upload-rqtl2-bundle", make_data_uploader( |