diff --git a/index.html b/index.html
index 12fbd86..3e06248 100644
--- a/index.html
+++ b/index.html
@@ -5,6 +5,54 @@
Lexy's Labyrinth
+
@@ -80,6 +128,8 @@
oops!
Sorry, the game was unable to load at all.
If you have JavaScript partly or wholly blocked, I salute you! ...but this is an interactive game and cannot work without it.
+ I did manage to capture this error, which you might be able to report somewhere:
+
...loading...
@@ -88,7 +138,6 @@
diff --git a/js/main.js b/js/main.js
index c6b7245..f864537 100644
--- a/js/main.js
+++ b/js/main.js
@@ -4033,17 +4033,13 @@ async function main() {
await main();
}
catch (e) {
- let failed = document.getElementById('failed');
- document.getElementById('loading').setAttribute('hidden', '');
- failed.removeAttribute('hidden');
- document.body.setAttribute('data-mode', 'failed');
-
- failed.appendChild(mk('p',
- "I did manage to capture this error, which you might be able to ",
- mk('a', {href: 'https://github.com/eevee/lexys-labyrinth'}, "report somewhere"),
- ":",
- ));
- failed.appendChild(mk('pre.stack-trace', e.toString(), "\n\n", (e.stack ?? "").replace(/^/mg, " ")));
+ if (ll_log_fatal_error) {
+ ll_log_fatal_error(e);
+ }
throw e;
}
+
+ if (ll_successfully_loaded) {
+ ll_successfully_loaded();
+ }
})();
diff --git a/style.css b/style.css
index eb54e21..3c3fb28 100644
--- a/style.css
+++ b/style.css
@@ -505,6 +505,12 @@ body[data-mode=player] #editor-play {
margin: auto;
text-align: center;
}
+#failed .-with-error {
+ display: none;
+}
+#failed.--got-error .-with-error {
+ display: revert;
+}
#loading {
font-size: 2em;
}