Merge pull request +11950 from c9/raygun

Do not flood raygun
pull/248/head
Harutyun Amirjanyan 2016-02-01 19:30:27 +04:00
commit 5d8515faeb
2 zmienionych plików z 16 dodań i 12 usunięć

Wyświetl plik

@ -56,7 +56,7 @@
"c9"
],
"c9plugins": {
"c9.ide.language": "#9ec48a2b65",
"c9.ide.language": "#197e5eb0d0",
"c9.ide.language.css": "#be07d72209",
"c9.ide.language.generic": "#a4023db7f6",
"c9.ide.language.html": "#9be847c0ce",

Wyświetl plik

@ -1419,12 +1419,13 @@ window.TraceKit = TraceKit;
}
var blackListedErrors = {
'Error with empty message': {},
'Script error.': {},
'DealPly is not defined': { factor: 10e5 },
"Cannot read property 'style' of null": { factor: 10e3 },
"Project with id '<id>' does not exist": { factor: 10e2 },
"Workspace not found": { factor: 10e2 },
count: 0,
'#Error with empty message': {},
'#Script error.': {},
'#DealPly is not defined': { factor: 10e5 },
"#Cannot read property 'style' of null": { factor: 10e3 },
"#Project with id '<id>' does not exist": { factor: 10e2 },
"#Workspace not found": { factor: 10e2 },
};
var groupedErrors = [{
regex: /^((?:Project|User) with id ')(\d+)(' does not exist)/i,
@ -1511,13 +1512,16 @@ window.TraceKit = TraceKit;
}
});
if (blackListedErrors.hasOwnProperty(message)) {
var count = (blackListedErrors[message].count || 0) + 1;
blackListedErrors[message].count = count;
if (count % (blackListedErrors[message].factor || 10) !== 1) {
var blackListEntry = blackListedErrors["#" + message];
if (blackListEntry) {
var count = (blackListEntry.count || 0) + 1;
blackListEntry.count = count;
if (count % (blackListEntry.factor || 10) !== 1) {
return;
}
finalCustomData.$blackList = blackListedErrors[message];
finalCustomData.$blackList = blackListEntry;
} else if (blackListedErrors.count < 10000) {
blackListedErrors["#" + message] = {};
}
var payload = {