Created
April 5, 2020 14:05
-
-
Save omrilotan/55d37e7fcdda66ba92f243f7d180a1c3 to your computer and use it in GitHub Desktop.
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
/** | |
* This is the signature of the browser's built in onerror handler | |
* @param {string} message Error message | |
* @param {string} file Source file where the script threw an error | |
* @param {number} line Line number | |
* @param {number} column Column number | |
* @param {Error} error Error object | |
* @return {Boolean} Should the default event handler fire? | |
*/ | |
function myOnErrorHandler(message, file, line, column, error) { | |
const record = { | |
message, | |
file, | |
line, | |
column, | |
stack: error.stack, | |
name: error.name, | |
}; | |
... | |
sendError(record); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment