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' ;
22import { DsnLike , SentryEvent , SentryEventHint } from '@sentry/types' ;
3+ import { logger } from '@sentry/utils/logger' ;
34import { getGlobalObject } from '@sentry/utils/misc' ;
45import { BrowserBackend , BrowserOptions } from './backend' ;
56import { SDK_NAME , SDK_VERSION } from './version' ;
@@ -78,14 +79,21 @@ export class BrowserClient extends BaseClient<BrowserBackend, BrowserOptions> {
7879 return ;
7980 }
8081
82+ if ( ! this . isEnabled ( ) ) {
83+ logger . error ( 'Trying to call showReportDialog with Sentry Client is disabled' ) ;
84+ return ;
85+ }
86+
8187 const dsn = options . dsn || this . getDsn ( ) ;
8288
8389 if ( ! options . eventId ) {
84- throw new SentryError ( 'Missing `eventId` option in showReportDialog call' ) ;
90+ logger . error ( 'Missing `eventId` option in showReportDialog call' ) ;
91+ return ;
8592 }
8693
8794 if ( ! dsn ) {
88- throw new SentryError ( 'Missing `Dsn` option in showReportDialog call' ) ;
95+ logger . error ( 'Missing `Dsn` option in showReportDialog call' ) ;
96+ return ;
8997 }
9098
9199 const script = document . createElement ( 'script' ) ;
You can’t perform that action at this time.
0 commit comments