summaryrefslogtreecommitdiff
path: root/static/js/pad_utils.js
diff options
context:
space:
mode:
authorPeter 'Pita' Martischka <petermartischka@googlemail.com>2011-08-17 19:24:44 +0100
committerPeter 'Pita' Martischka <petermartischka@googlemail.com>2011-08-17 19:24:44 +0100
commitc2457e06d8394fc9bdbbd8f80e483bed9e42bb12 (patch)
tree8e27020a38daf3b4b4923507c16321c87cbe9fbf /static/js/pad_utils.js
parentb58bdb4e4d4f9b97502bd5207f37929223c7e948 (diff)
downloadetherpad-lite-c2457e06d8394fc9bdbbd8f80e483bed9e42bb12.zip
send client side javascript errors to the server
Diffstat (limited to 'static/js/pad_utils.js')
-rw-r--r--static/js/pad_utils.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/static/js/pad_utils.js b/static/js/pad_utils.js
index fc88553d..331590fe 100644
--- a/static/js/pad_utils.js
+++ b/static/js/pad_utils.js
@@ -461,3 +461,15 @@ var padutils = {
});
}
};
+
+//send javascript errors to the server
+window.onerror = function test (msg, url, linenumber)
+{
+ var errObj = {errorInfo: JSON.stringify({msg: msg, url: url, linenumber: linenumber, userAgent: navigator.userAgent})};
+ var loc = document.location;
+ var url = loc.protocol + "//" + loc.hostname + ":" + loc.port + "/" + loc.pathname.substr(1, loc.pathname.indexOf("/p/")) + "jserror";
+
+ $.post(url, errObj);
+
+ return false;
+};