Created
March 9, 2016 15:13
-
-
Save jonathanweiss/202f08b97c53ef0a11f3 to your computer and use it in GitHub Desktop.
Husky Error Handling
This file contains 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, source, lineno, colno, error) { | |
var stack = ''; | |
var browser = navigator.userAgent; | |
if (error && error.stack) { | |
stack = JSON.stringify(error.stack) | |
} | |
var errorData = { | |
Message: message, | |
Source: source, | |
LineNumber: lineno, | |
ColumnNumber: colno, | |
UserAgent: browser, | |
StackTrace: stack | |
}; | |
return true; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment