Skip to content

Instantly share code, notes, and snippets.

@danreeves
Last active August 29, 2015 14:23
Show Gist options
  • Save danreeves/fd2b31945650f0eca1a4 to your computer and use it in GitHub Desktop.
Save danreeves/fd2b31945650f0eca1a4 to your computer and use it in GitHub Desktop.
window.onerror = function (message, url, lineNo) {
try {
var xhr = new (window.XMLHttpRequest || ActiveXObject)('MSXML2.XMLHTTP.3.0'),
domain ='https://example.com/',
query = '?line=' + lineNo +
'&message=' + message +
'&url=' + url +
'&UA=' + window.navigator.userAgent;
xhr.open('GET', domain + query, true);
xhr.send();
} catch (s) {}
return true;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment