kopia lustrzana https://github.com/c9/core
add a way to group raygun errors with parametrized messages
rodzic
0f75645437
commit
2f55e03b36
|
@ -1422,6 +1422,19 @@ window.TraceKit = TraceKit;
|
||||||
'Script error.': {},
|
'Script error.': {},
|
||||||
'DealPly is not defined': { factor: 10e5 }
|
'DealPly is not defined': { factor: 10e5 }
|
||||||
};
|
};
|
||||||
|
var groupedErrors = [{
|
||||||
|
regex: /^((?:Project|User) with id ')(\d+)(' does not exist)/i,
|
||||||
|
pullOut: { 1: 'id' }
|
||||||
|
}, {
|
||||||
|
regex: /^(Failed to execute 'send' on 'XMLHttpRequest': Failed to load)([\s\S]*)/i,
|
||||||
|
pullOut: { 1: 'url' }
|
||||||
|
}, {
|
||||||
|
regex: /^(Cannot GET \/)([\s\S]*)/i,
|
||||||
|
pullOut: { 1: 'url' }
|
||||||
|
}, {
|
||||||
|
regex: /^(Error whilst parsing: Unexpected end whilst parsing xpath \/)([\s\S]*)/i,
|
||||||
|
pullOut: { 1: 'apfStuff' }
|
||||||
|
}];
|
||||||
function processUnhandledException(stackTrace, options) {
|
function processUnhandledException(stackTrace, options) {
|
||||||
var stack = [],
|
var stack = [],
|
||||||
qs = {};
|
qs = {};
|
||||||
|
@ -1477,6 +1490,22 @@ window.TraceKit = TraceKit;
|
||||||
|
|
||||||
// c9!
|
// c9!
|
||||||
var message = custom_message || stackTrace.message || options.status || 'Error with empty message';
|
var message = custom_message || stackTrace.message || options.status || 'Error with empty message';
|
||||||
|
|
||||||
|
groupedErrors.some(function(g) {
|
||||||
|
if (g.regex.test(message)) {
|
||||||
|
var parts = message.split(g.regex);
|
||||||
|
message = "";
|
||||||
|
parts.forEach(function(p, i) {
|
||||||
|
if (g.pullOut[i - 1]) {
|
||||||
|
finalCustomData[g.pullOut[i - 1]] = p;
|
||||||
|
} else {
|
||||||
|
message += p;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
if (blackListedErrors.hasOwnProperty(message)) {
|
if (blackListedErrors.hasOwnProperty(message)) {
|
||||||
var count = (blackListedErrors[message].count || 0) + 1;
|
var count = (blackListedErrors[message].count || 0) + 1;
|
||||||
blackListedErrors[message].count = count;
|
blackListedErrors[message].count = count;
|
||||||
|
|
Ładowanie…
Reference in New Issue