xxxxxxxxxx
window.onerror = function (msg, url, lineNo, columnNo, error) {
// ... handle error ...
return false;
}
xxxxxxxxxx
window.onerror = (event, source, lineno, colno, error) => {
console.log(`message: ${event}`);
console.log(`source: ${source}`);
console.log(`lineno: ${lineno}`);
console.log(`colno: ${colno}`);
console.log(`error: ${error}`);
return false; // true if you want to consume event
};