summaryrefslogtreecommitdiffstats
path: root/misc/dist/html/editor.html
diff options
context:
space:
mode:
authorAdam Scott <ascott.ca@gmail.com>2024-05-30 11:01:07 -0400
committerAdam Scott <ascott.ca@gmail.com>2024-05-30 12:38:08 -0400
commit2c3b871b3b03df72749e762913b034cbb564ddd5 (patch)
tree59d5c2e18c303361fa7e3fabe49436675aa3fc99 /misc/dist/html/editor.html
parente7dd6f11ed1ed4d72186d3a90d5f4ef42e79c4d0 (diff)
downloadredot-engine-2c3b871b3b03df72749e762913b034cbb564ddd5.tar.gz
Make displayed Web errors more meaningful
Diffstat (limited to 'misc/dist/html/editor.html')
-rw-r--r--misc/dist/html/editor.html11
1 files changed, 8 insertions, 3 deletions
diff --git a/misc/dist/html/editor.html b/misc/dist/html/editor.html
index e5c68c6338..5959b7b664 100644
--- a/misc/dist/html/editor.html
+++ b/misc/dist/html/editor.html
@@ -701,9 +701,14 @@ function startEditor(zip) {
editor = new Engine(editorConfig);
function displayFailureNotice(err) {
- const msg = err.message || err;
- console.error(msg);
- setStatusNotice(msg);
+ console.error(err);
+ if (err instanceof Error) {
+ setStatusNotice(err.message);
+ } else if (typeof err === 'string') {
+ setStatusNotice(err);
+ } else {
+ setStatusNotice('An unknown error occured');
+ }
setStatusMode('notice');
initializing = false;
}