diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-05-31 14:16:49 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-05-31 14:16:49 +0200 |
commit | cf9af1e850c563ebd29c46b55cfadd9120afad42 (patch) | |
tree | a23e50f6128682832f4e365303b939d140dcd4e6 | |
parent | 8b044da3967b654e97c769b2222b713bf4992bc2 (diff) | |
parent | 2c3b871b3b03df72749e762913b034cbb564ddd5 (diff) | |
download | redot-engine-cf9af1e850c563ebd29c46b55cfadd9120afad42.tar.gz |
Merge pull request #92553 from adamscott/more-meaningful-errors
Make displayed Web errors more meaningful
-rw-r--r-- | misc/dist/html/editor.html | 11 | ||||
-rw-r--r-- | misc/dist/html/full-size.html | 11 |
2 files changed, 16 insertions, 6 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; } diff --git a/misc/dist/html/full-size.html b/misc/dist/html/full-size.html index fc34164368..1d76abe0a5 100644 --- a/misc/dist/html/full-size.html +++ b/misc/dist/html/full-size.html @@ -134,9 +134,14 @@ const engine = new Engine(GODOT_CONFIG); } 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; } |