File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -11,13 +11,17 @@ import * as Sentry from '@sentry/node';
1111
1212dotenv . config ( ) ;
1313
14- Sentry . init ( {
15- dsn : process . env . BFF_SENTRY_DSN ,
16- // Setting this option to true will send default PII data to Sentry.
17- // For example, automatic IP address collection on events
18- sendDefaultPii : true ,
19- environment : process . env . VITE_ENVIRONMENT ,
20- } ) ;
14+ if ( ! process . env . BFF_SENTRY_DSN || process . env . BFF_SENTRY_DSN . trim ( ) === '' ) {
15+ console . error ( 'Error: Sentry DSN is not provided. Sentry will not be initialized.' ) ;
16+ } else {
17+ Sentry . init ( {
18+ dsn : process . env . BFF_SENTRY_DSN ,
19+ // Setting this option to true will send default PII data to Sentry.
20+ // For example, automatic IP address collection on events
21+ sendDefaultPii : true ,
22+ environment : process . env . VITE_ENVIRONMENT ,
23+ } ) ;
24+ }
2125
2226const isLocalDev = process . argv . includes ( '--local-dev' ) ;
2327
You can’t perform that action at this time.
0 commit comments