Commit c673c9e4 authored by Vignesh Mohankumar's avatar Vignesh Mohankumar Committed by GitHub

fix: filter user reject errors temporarily (#6840)

parent dd957d07
...@@ -54,9 +54,9 @@ describe('beforeSend', () => { ...@@ -54,9 +54,9 @@ describe('beforeSend', () => {
expect(beforeSend(ERROR, { originalException })).toBe(ERROR) expect(beforeSend(ERROR, { originalException })).toBe(ERROR)
}) })
it('propagates user rejected request errors', () => { it('filters user rejected request errors', () => {
const originalException = new Error('user rejected transaction') const originalException = new Error('user rejected transaction')
expect(beforeSend(ERROR, { originalException })).toBe(ERROR) expect(beforeSend(ERROR, { originalException })).toBeNull()
}) })
it('filters block number polling errors', () => { it('filters block number polling errors', () => {
......
import { ClientOptions, ErrorEvent, EventHint } from '@sentry/types' import { ClientOptions, ErrorEvent, EventHint } from '@sentry/types'
import { didUserReject } from 'utils/swapErrorToUserReadableMessage'
// `responseStatus` is only currently supported on certain browsers. // `responseStatus` is only currently supported on certain browsers.
// see: https://caniuse.com/mdn-api_performanceresourcetiming_responsestatus // see: https://caniuse.com/mdn-api_performanceresourcetiming_responsestatus
...@@ -50,6 +51,10 @@ function shouldRejectError(error: EventHint['originalException']) { ...@@ -50,6 +51,10 @@ function shouldRejectError(error: EventHint['originalException']) {
if (method === 'eth_blockNumber') return true if (method === 'eth_blockNumber') return true
} }
// If the error is based on a user rejecting, it should not be considered an exception.
// TODO(WEB-2398): we should catch these errors and handle them gracefully instead.
if (didUserReject(error)) return true
// If the error is a network change, it should not be considered an exception. // If the error is a network change, it should not be considered an exception.
if (error.message.match(/underlying network changed/)) return true if (error.message.match(/underlying network changed/)) return true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment