Limit JS error logging

This commit is contained in:
Hillel Coren 2018-02-21 17:54:58 +02:00
parent 21dfd43c81
commit b1338555fd
2 changed files with 7 additions and 1 deletions

View File

@ -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;