« get me outta code hell

client: report uncaught runtime errors in search worker - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/static/js/search-worker.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-05-17 21:41:55 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-05-31 12:11:55 -0300
commit3fa1bdd574773e79f4861f6f3034fb9c4ec63ffe (patch)
treeb4b964990eecf013472b66958993704b980af381 /src/static/js/search-worker.js
parent3d7d540611f7fb4870f6886392d2694f0c6003e6 (diff)
client: report uncaught runtime errors in search worker
Diffstat (limited to 'src/static/js/search-worker.js')
-rw-r--r--src/static/js/search-worker.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/static/js/search-worker.js b/src/static/js/search-worker.js
index 9a7827da..66c0cf2e 100644
--- a/src/static/js/search-worker.js
+++ b/src/static/js/search-worker.js
@@ -26,6 +26,7 @@ let status = null;
 let indexes = null;
 
 onmessage = handleWindowMessage;
+onerror = handleRuntimeError;
 postStatus('alive');
 
 Promise.all([
@@ -302,6 +303,10 @@ function importIndex(indexKey, indexData) {
   }
 }
 
+function handleRuntimeError() {
+  postStatus('runtime-error');
+}
+
 function handleWindowMessage(message) {
   switch (message.data.kind) {
     case 'action':