aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-04-25 10:12:01 -0700
committerAlon Zakai <alonzakai@gmail.com>2014-04-25 10:12:01 -0700
commitffa17762a625018c557a39056ac8eb0b54251694 (patch)
tree2f7db85dec8bffd8e9485da437fee357292ae6c1
parentb302308c7d451f17eb6dd2bade749800ea2d3925 (diff)
indicate an error in the html shell when an exception is not caught
-rw-r--r--src/shell.html7
-rw-r--r--src/shell_minimal.html7
2 files changed, 14 insertions, 0 deletions
diff --git a/src/shell.html b/src/shell.html
index 226f12b9..1e213024 100644
--- a/src/shell.html
+++ b/src/shell.html
@@ -1273,6 +1273,13 @@
}
};
Module.setStatus('Downloading...');
+ window.onerror = function() {
+ Module.setStatus('Exception thrown, see JavaScript console');
+ spinnerElement.style.display = 'none';
+ Module.setStatus = function(text) {
+ if (text) Module.printErr('[post-exception status] ' + text);
+ };
+ };
</script>
{{{ SCRIPT }}}
</body>
diff --git a/src/shell_minimal.html b/src/shell_minimal.html
index 6f483719..7dd67929 100644
--- a/src/shell_minimal.html
+++ b/src/shell_minimal.html
@@ -129,6 +129,13 @@
}
};
Module.setStatus('Downloading...');
+ window.onerror = function() {
+ Module.setStatus('Exception thrown, see JavaScript console');
+ spinnerElement.style.display = 'none';
+ Module.setStatus = function(text) {
+ if (text) Module.printErr('[post-exception status] ' + text);
+ };
+ };
</script>
{{{ SCRIPT }}}
</body>