summaryrefslogtreecommitdiff
path: root/static/js/pad_utils.js
diff options
context:
space:
mode:
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;
+};