File tree Expand file tree Collapse file tree 1 file changed +20
-4
lines changed Expand file tree Collapse file tree 1 file changed +20
-4
lines changed Original file line number Diff line number Diff line change 11import * as React from 'react' ;
22import * as ReactDOM from 'react-dom' ;
3-
43import * as Sentry from '@sentry/react' ;
54import { BrowserTracing } from '@sentry/tracing' ;
6- import { CaptureConsole as CaptureConsoleIntegration } from '@sentry/integrations' ;
75
86import App from './App' ;
97
108Sentry . init ( {
119 dsn : process . env . SENTRY_DSN ,
1210 integrations : [
13- new BrowserTracing ( ) ,
14- new CaptureConsoleIntegration ( { levels : [ 'error' ] } ) ,
11+ new BrowserTracing ( )
1512 ] ,
1613 tracesSampleRate : 1.0 ,
14+ beforeSend ( event , hint ) {
15+ const error = hint . originalException ;
16+
17+ const ignoreErrors = [
18+ / G r a p h Q L / i, // filter out graphql errors
19+ / F a i l e d t o f e t c h / i // filter out failed to fetch network errors
20+ ]
21+
22+ // filter out blacklisted errors
23+ if ( error && error . message ) {
24+ for ( const filter in ignoreErrors ) {
25+ if ( error . message . match ( filter ) ) {
26+ return null
27+ }
28+ }
29+ }
30+
31+ return event ;
32+ } ,
1733} ) ;
1834
1935const root = document . getElementById ( 'root' ) ;
You can’t perform that action at this time.
0 commit comments