I've setup filters for rollbar.js and it does not work on production servers. I still can see new rollbar items are creating with payload data are not allowed:
const ignoredCodes = {
401: 'Unauthorized',
};
new Rollbar({
checkIgnore: function (isUncaught, args, payload: any) {
const { body } = payload;
if (body?.trace?.extra) {
if (Object.keys(ignoredCodes).includes(`${body.trace.extra.status}`)) return true;
if (Object.values(ignoredCodes).includes(body.trace.extra.error)) return true;
}
return false;
},
})
Please can you help to find a reason why rollbar items are still creating for trace -> extra -> status equals 401
The only thing I notice is the ignoredCodes key '401' is a string. If body.trace.extra.status is a number, one or the other needs to be converted for includes() to work.
I've setup filters for rollbar.js and it does not work on production servers. I still can see new rollbar items are creating with payload data are not allowed:
Please can you help to find a reason why rollbar items are still creating for trace -> extra -> status equals 401