mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-22 15:40:55 -04:00
Clean up error logs
This commit is contained in:
parent
93cec78d6e
commit
c5cac623a7
@ -59,14 +59,17 @@
|
|||||||
NINJA.isRegistered = {{ \Utils::isRegistered() ? 'true' : 'false' }};
|
NINJA.isRegistered = {{ \Utils::isRegistered() ? 'true' : 'false' }};
|
||||||
|
|
||||||
window.onerror = function (errorMsg, url, lineNumber, column, error) {
|
window.onerror = function (errorMsg, url, lineNumber, column, error) {
|
||||||
|
// Error in hosted third party library
|
||||||
if (errorMsg.indexOf('Script error.') > -1) {
|
if (errorMsg.indexOf('Script error.') > -1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// Error due to incognito mode
|
||||||
|
if (errorMsg.indexOf('DOM Exception 22') > -1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
// Use StackTraceJS to parse the error context
|
// Use StackTraceJS to parse the error context
|
||||||
if (error) {
|
if (error) {
|
||||||
var message = error.message ? error.message : error;
|
|
||||||
StackTrace.fromError(error).then(function (result) {
|
StackTrace.fromError(error).then(function (result) {
|
||||||
var gps = new StackTraceGPS();
|
var gps = new StackTraceGPS();
|
||||||
gps.findFunctionName(result[0]).then(function (result) {
|
gps.findFunctionName(result[0]).then(function (result) {
|
||||||
@ -78,8 +81,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
trackEvent('/error', errorMsg);
|
trackEvent('/error', errorMsg);
|
||||||
} catch (err) {
|
} catch (err) {}
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user