summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/templates/pad.html13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/templates/pad.html b/src/templates/pad.html
index 36d6334c..6821b5e6 100644
--- a/src/templates/pad.html
+++ b/src/templates/pad.html
@@ -316,6 +316,19 @@
<% e.end_block(); %>
<% e.begin_block("scripts"); %>
+ <script type="text/javascript">
+ /* Display errors on page load to the user
+ (Gets overridden by padutils.setupGlobalExceptionHandler)
+ */
+ window.onerror = function(msg, url, line) {
+ console.log('error', arguments);
+ var box = document.getElementById('editorloadingbox');
+ box.innerHTML = '<p><b>An error occured while loading the pad</b></p>'
+ + '<p><b>'+msg+'</b> '
+ + '<small>in '+ url +' (line '+ line +')</small></p>'
+ };
+ </script>
+
<script type="text/javascript" src="../static/js/require-kernel.js"></script>
<script type="text/javascript" src="../socket.io/socket.io.js"></script>