Skip to content

Commit

Permalink
try to improve sentry filtering for js events
Browse files Browse the repository at this point in the history
  • Loading branch information
longhotsummer committed Aug 30, 2024
1 parent a10b290 commit 1e054bc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions peachjam/js/peachjam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,10 @@ class PeachJam {
}

const frames = event.exception.values[0].stacktrace.frames;
// if all frames are anonymous, don't send this event

// if first frame is anonymous, don't send this event
// see https://github.com/getsentry/sentry-javascript/issues/3147
if (frames && frames.length > 0 && frames.every((f: any) => f.filename === '<anonymous>')) {
if (frames && frames.length > 0 && frames[0].filename === '<anonymous>') {
return null;
}
} catch (e) {
Expand Down

0 comments on commit 1e054bc

Please sign in to comment.