diff --git a/plugins/c9.ide.errorhandler/raygun.js b/plugins/c9.ide.errorhandler/raygun.js index 9931997f..63aa3f59 100644 --- a/plugins/c9.ide.errorhandler/raygun.js +++ b/plugins/c9.ide.errorhandler/raygun.js @@ -1422,6 +1422,19 @@ window.TraceKit = TraceKit; 'Script error.': {}, '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) { var stack = [], qs = {}; @@ -1477,6 +1490,22 @@ window.TraceKit = TraceKit; // c9! 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)) { var count = (blackListedErrors[message].count || 0) + 1; blackListedErrors[message].count = count;