File tree Expand file tree Collapse file tree 4 files changed +35
-29
lines changed
web-app/src/services/sentry Expand file tree Collapse file tree 4 files changed +35
-29
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,10 @@ import { init } from '@sentry/node'
22import { SENTRY_DSN , NODE_ENV } from '../../environment'
33
44if ( SENTRY_DSN ) {
5- init ( {
6- dsn : SENTRY_DSN ,
7- environment : NODE_ENV ,
8- } )
5+ if ( NODE_ENV === 'production' ) {
6+ init ( {
7+ dsn : SENTRY_DSN ,
8+ environment : NODE_ENV ,
9+ } )
10+ }
911}
Original file line number Diff line number Diff line change 11import * as sentry from '@sentry/node'
22// import { Scope } from '@sentry/hub'
3- import { VERSION } from '../../environment'
3+ import { VERSION , NODE_ENV } from '../../environment'
44
55const onError = ( error : Error ) => {
6- // set user scope https://docs.sentry.io/enriching-error-data/scopes/?platform=node
7- sentry . withScope ( ( scope : any ) => {
8- scope . setTag ( 'VERSION' , VERSION )
9- // if (user) {
10- // scope.setUser({
11- // id: user.id,
12- // email: user.email || 'unknown',
13- // })
14- // }
15- sentry . captureException ( error )
16- } )
6+ if ( NODE_ENV === 'production' ) {
7+ // set user scope https://docs.sentry.io/enriching-error-data/scopes/?platform=node
8+ sentry . withScope ( ( scope : any ) => {
9+ scope . setTag ( 'VERSION' , VERSION )
10+ // if (user) {
11+ // scope.setUser({
12+ // id: user.id,
13+ // email: user.email || 'unknown',
14+ // })
15+ // }
16+ sentry . captureException ( error )
17+ } )
18+ }
1719}
1820
1921export default onError
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import * as sentry from '@sentry/browser'
22import { NODE_ENV , SENTRY_DSN } from '../../environment'
33
44try {
5- if ( SENTRY_DSN ) {
5+ if ( SENTRY_DSN && NODE_ENV === 'production' ) {
66 sentry . init ( {
77 dsn : SENTRY_DSN ,
88 environment : NODE_ENV ,
Original file line number Diff line number Diff line change 11import * as sentry from '@sentry/browser'
22// import { Scope } from '@sentry/hub'
3- import { VERSION } from '../../environment'
3+ import { VERSION , NODE_ENV } from '../../environment'
44
55const onError = ( error : Error ) => {
6- // set user scope https://docs.sentry.io/enriching-error-data/scopes/?platform=node
7- sentry . withScope ( ( scope : any ) => {
8- scope . setTag ( 'VERSION' , VERSION )
9- // if (user) {
10- // scope.setUser({
11- // id: user.id,
12- // email: user.email || 'unknown',
13- // })
14- // }
15- sentry . captureException ( error )
16- } )
6+ if ( NODE_ENV === 'production' ) {
7+ // set user scope https://docs.sentry.io/enriching-error-data/scopes/?platform=node
8+ sentry . withScope ( ( scope : any ) => {
9+ scope . setTag ( 'VERSION' , VERSION )
10+ // if (user) {
11+ // scope.setUser({
12+ // id: user.id,
13+ // email: user.email || 'unknown',
14+ // })
15+ // }
16+ sentry . captureException ( error )
17+ } )
18+ }
1719}
1820
1921export default onError
You can’t perform that action at this time.
0 commit comments