mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Limit JS error logging
This commit is contained in:
parent
21dfd43c81
commit
b1338555fd
@ -57,8 +57,14 @@
|
||||
var NINJA = NINJA || {};
|
||||
NINJA.fontSize = 9;
|
||||
NINJA.isRegistered = {{ \Utils::isRegistered() ? 'true' : 'false' }};
|
||||
NINJA.loggedErrorCount = 0;
|
||||
|
||||
window.onerror = function (errorMsg, url, lineNumber, column, error) {
|
||||
if (NINJA.loggedErrorCount > 5) {
|
||||
return;
|
||||
}
|
||||
NINJA.loggedErrorCount++;
|
||||
|
||||
// Error in hosted third party library
|
||||
if (errorMsg.indexOf('Script error.') > -1) {
|
||||
return;
|
||||
|
@ -85,7 +85,7 @@
|
||||
$form.get(0).submit();
|
||||
} else {
|
||||
$('#js-error-message').html('An error occurred').fadeIn();
|
||||
logError('STRIPE_ERROR:' + JSON.stringify(response));
|
||||
logError('STRIPE_ERROR: ' + JSON.stringify(response));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user