From b32d003cc954b5369d3aaa0161c1fc52c0342b32 Mon Sep 17 00:00:00 2001 From: Matchman Date: Tue, 20 Mar 2018 16:36:48 +0800 Subject: [PATCH] Display error when upload fails #51 --- lib/static/hearty_rabbit.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/static/hearty_rabbit.js b/lib/static/hearty_rabbit.js index 8647ade2..66b5c6cf 100644 --- a/lib/static/hearty_rabbit.js +++ b/lib/static/hearty_rabbit.js @@ -94,8 +94,13 @@ function upload_file(file) else { console.warn("Upload failure:", req.status); + alert("onload(): cannot upload file: " + req.statusText); } }; + req.onerror = () => + { + alert("onerror(): cannot upload file: " + req.statusText); + }; req.send(file); show_lightbox("/loading.svg"); }