Skip to content

Commit

Permalink
Make displayed Web errors more meaningful
Browse files Browse the repository at this point in the history
  • Loading branch information
adamscott committed May 30, 2024
1 parent e7dd6f1 commit 2c3b871
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
11 changes: 8 additions & 3 deletions misc/dist/html/editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -701,9 +701,14 @@ <h2 id="welcome-modal-title" class="welcome-modal-title">Important - Please read
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;
}
Expand Down
11 changes: 8 additions & 3 deletions misc/dist/html/full-size.html
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,14 @@
}

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;
}
Expand Down

0 comments on commit 2c3b871

Please sign in to comment.