summaryrefslogtreecommitdiff
path: root/src/templates
diff options
context:
space:
mode:
authorMarcel Klehr <mklehr@gmx.net>2012-07-23 14:12:36 +0200
committerMarcel Klehr <mklehr@gmx.net>2012-07-23 14:12:36 +0200
commitfa3020dffdab4a69bba045965ca038ca3d21575a (patch)
treeab44dca551efa484cb238bcc35010fb429ae008c /src/templates
parent76933f2b1d1dc1ec3e028b32592aea3400f9dff6 (diff)
downloadetherpad-lite-fa3020dffdab4a69bba045965ca038ca3d21575a.zip
Display errors occuring on page load to the user.
Diffstat (limited to 'src/templates')
-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>