Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration for checkIgnore does not work #1101

Open
moskvin opened this issue Apr 17, 2023 · 1 comment
Open

Configuration for checkIgnore does not work #1101

moskvin opened this issue Apr 17, 2023 · 1 comment

Comments

@moskvin
Copy link

moskvin commented Apr 17, 2023

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

@waltjones
Copy link
Contributor

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.

Otherwise, everything looks correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants