Skip to content

Commit

Permalink
fix: force fix of sentry client
Browse files Browse the repository at this point in the history
  • Loading branch information
ovflowd committed Nov 14, 2023
1 parent c7291c8 commit f44f121
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions sentry.client.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,20 @@ init({
// we only want to capture errors from _next folder on production
// we don't want to capture errors from preview branches here
allowUrls: ['https://nodejs.org/_next'],
// Filter-out Events/Errors that are invalid for us
beforeSend: (event, hint) => {
const originalException = hint.originalException as Error;

// All the Events we send must have a message and stack trace
if (originalException?.message && originalException?.stack) {
// All our Events come eventually from code that originates on node_modules
// so everything else should be discarded
// Even React Errors or other errors will eventually have node_modules in the code
if (String(originalException.stack).includes('node_modules')) {
return event;
}
}

return null;
},
});

0 comments on commit f44f121

Please sign in to comment.