Improve error logging

This commit is contained in:
Hillel Coren 2018-01-08 15:59:10 +02:00
parent 1d947c5d30
commit aa40120b2c

View File

@ -67,6 +67,10 @@
if (errorMsg.indexOf('DOM Exception 22') > -1) { if (errorMsg.indexOf('DOM Exception 22') > -1) {
return; return;
} }
// Less than IE9 https://stackoverflow.com/a/14835682/497368
if (! document.addEventListener) {
return;
}
try { try {
// Use StackTraceJS to parse the error context // Use StackTraceJS to parse the error context
if (error) { if (error) {
@ -75,6 +79,8 @@
gps.findFunctionName(result[0]).then(function (result) { gps.findFunctionName(result[0]).then(function (result) {
logError(errorMsg + ': ' + JSON.stringify(result)); logError(errorMsg + ': ' + JSON.stringify(result));
}); });
}).catch(function () {
logError(errorMsg);
}); });
} else { } else {
logError(errorMsg); logError(errorMsg);