File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 1
- import { API , BaseClient , Scope , SentryError } from '@sentry/core' ;
1
+ import { API , BaseClient , Scope } from '@sentry/core' ;
2
2
import { DsnLike , SentryEvent , SentryEventHint } from '@sentry/types' ;
3
+ import { logger } from '@sentry/utils/logger' ;
3
4
import { getGlobalObject } from '@sentry/utils/misc' ;
4
5
import { BrowserBackend , BrowserOptions } from './backend' ;
5
6
import { SDK_NAME , SDK_VERSION } from './version' ;
@@ -78,14 +79,21 @@ export class BrowserClient extends BaseClient<BrowserBackend, BrowserOptions> {
78
79
return ;
79
80
}
80
81
82
+ if ( ! this . isEnabled ( ) ) {
83
+ logger . error ( 'Trying to call showReportDialog with Sentry Client is disabled' ) ;
84
+ return ;
85
+ }
86
+
81
87
const dsn = options . dsn || this . getDsn ( ) ;
82
88
83
89
if ( ! options . eventId ) {
84
- throw new SentryError ( 'Missing `eventId` option in showReportDialog call' ) ;
90
+ logger . error ( 'Missing `eventId` option in showReportDialog call' ) ;
91
+ return ;
85
92
}
86
93
87
94
if ( ! dsn ) {
88
- throw new SentryError ( 'Missing `Dsn` option in showReportDialog call' ) ;
95
+ logger . error ( 'Missing `Dsn` option in showReportDialog call' ) ;
96
+ return ;
89
97
}
90
98
91
99
const script = document . createElement ( 'script' ) ;
You can’t perform that action at this time.
0 commit comments