How can I prevent Sentry from reporting an error in javascript in the browswer?

Viewed 836

It seems like Sentry is reporting an error I intentionally swallow. Why is this? How can I tell Sentry not to report on this swallowed error?

Sentry Screenshot

1 Answers
Sentry.init({
  ignoreErrors: ['NotSupportedError']
  // or
  ignoreErrors: [/operation is not supported/]
})

or with beforeSend

Sentry.init({
  beforeSend(event) {
    // or `value` instead of a `type`
    if (event.exception && event.exception.values[0].type === 'NotSupportedError') {
      return null
    }
    return event;
  }
})
Related