I was playing with the airbrake-js requirejs example and trying to filter out project_root from backtrace lines
Here is my airbrake-js addFilter for filtering out project root
airbrake.addFilter(function(notice) {
var projectRoot = 'PROJECT_ROOT';
for (i = 0; i < notice.errors.length; i++) {
for(j = 0; j < notice.errors[i].backtrace.length; j++) {
notice.errors[i].backtrace[j].file = notice.errors[i].backtrace[j].file.replace(projectRoot, '')
};
};
return notice;
});
Also this gist has my full app.js if you want to mess around with it.