First we need to override the handler as:
We can add two more variables to get more information: column number and error object.
Note: This will work only in the latest browsers.
window.onerror = function (errorMsg, url, lineNumber) {
console.log('Error: ' + errorMsg + ' Script: ' + url + ' Line: ' + lineNumber);
}
We can add two more variables to get more information: column number and error object.
window.onerror = function (errorMsg, url, lineNumber, column, errorObj) {
console.log('Error: ' + errorMsg + ' Script: ' + url + ' Line: ' + lineNumber
+ ' Column: ' + column + ' StackTrace: ' + errorObj);
}
Note: This will work only in the latest browsers.
No comments:
Post a Comment