Created
January 7, 2018 20:20
-
-
Save Tom910/16b0e6a686864292bdf25e2e34955dd7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.onerror = function(message, file, line, column, error) { | |
var errorToReport = { | |
type: error ? error.type : '', | |
message: message, | |
file: file, | |
line: line, | |
column: column, | |
stack: error ? error.stack : '', | |
userAgent: navigator.userAgent, | |
href: location.href | |
}; | |
var url = '/error-reporting?error=' + | |
JSON.stringify(errorToReport); | |
var image = new Image(); | |
image.src = url; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment