aboutsummaryrefslogtreecommitdiff
path: root/qc_app/templates/rqtl2/upload-rqtl2-bundle-step-01.html
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-07-01 14:59:32 -0500
committerFrederick Muriuki Muriithi2024-07-01 14:59:32 -0500
commita68fe177ae41f2e58a64b3f8dcf3f825d004eeca (patch)
tree076b90e1ff1b3efa9ffd2b42588fef24c6ce88ea /qc_app/templates/rqtl2/upload-rqtl2-bundle-step-01.html
parentf0434c14b1359f8decf712926e502bd98822b38c (diff)
downloadgn-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.html15
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(