diff options
author | Peter 'Pita' Martischka <petermartischka@googlemail.com> | 2011-08-17 19:24:44 +0100 |
---|---|---|
committer | Peter 'Pita' Martischka <petermartischka@googlemail.com> | 2011-08-17 19:24:44 +0100 |
commit | c2457e06d8394fc9bdbbd8f80e483bed9e42bb12 (patch) | |
tree | 8e27020a38daf3b4b4923507c16321c87cbe9fbf /static/js/pad_utils.js | |
parent | b58bdb4e4d4f9b97502bd5207f37929223c7e948 (diff) | |
download | etherpad-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.js | 12 |
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; +}; |