diff --git a/misc/dist/html/editor.html b/misc/dist/html/editor.html index e5c68c63384..5959b7b6643 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 fc34164368a..1d76abe0a56 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; }