Skip to content

Instantly share code, notes, and snippets.

@omrilotan
Created April 5, 2020 14:05
Show Gist options
  • Save omrilotan/55d37e7fcdda66ba92f243f7d180a1c3 to your computer and use it in GitHub Desktop.
Save omrilotan/55d37e7fcdda66ba92f243f7d180a1c3 to your computer and use it in GitHub Desktop.
/**
* 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