I have an event handler that looks like this:
window.addEventListener('error', function (e) {
SendLogErrorToServer('Error: ' + e.message +
'Error object: ' + JSON.stringify(e) +
'Script: ' + e.filename +
'Line: ' + e.lineno +
'Col: ' + e.colno +
'Nav: ' + window.navigator.userAgent));
}, false);
The problem is that what I receive looks like this:
Error: Script error.Error object: {isTrusted:true} Script: Line: 0 Col: 0 Nav: Mozilla/5.0
As you can see, no line number or error message that's useful. What do I need to change to get the line number and error details?