@@ -66,22 +66,6 @@ export class Hub {
66
66
}
67
67
}
68
68
69
- /**
70
- * Internal helper function to call an async method on the top client if it
71
- * exists.
72
- *
73
- * @param method The method to call on the client/client.
74
- * @param args Arguments to pass to the client/frontend.
75
- */
76
- private invokeClientAsync ( method : string , ...args : any [ ] ) : void {
77
- const top = this . getStackTop ( ) ;
78
- if ( top && top . client && top . client [ method ] ) {
79
- top . client [ method ] ( ...args , top . scope ) . catch ( ( err : any ) => {
80
- logger . error ( err ) ;
81
- } ) ;
82
- }
83
- }
84
-
85
69
/**
86
70
* Checks if this hub's version is older than the given version.
87
71
*
@@ -196,7 +180,7 @@ export class Hub {
196
180
*/
197
181
public captureException ( exception : any , hint ?: SentryEventHint ) : string {
198
182
const eventId = ( this . _lastEventId = uuid4 ( ) ) ;
199
- this . invokeClientAsync ( 'captureException' , exception , {
183
+ this . invokeClient ( 'captureException' , exception , {
200
184
...hint ,
201
185
event_id : eventId ,
202
186
} ) ;
@@ -213,7 +197,7 @@ export class Hub {
213
197
*/
214
198
public captureMessage ( message : string , level ?: Severity , hint ?: SentryEventHint ) : string {
215
199
const eventId = ( this . _lastEventId = uuid4 ( ) ) ;
216
- this . invokeClientAsync ( 'captureMessage' , message , level , {
200
+ this . invokeClient ( 'captureMessage' , message , level , {
217
201
...hint ,
218
202
event_id : eventId ,
219
203
} ) ;
@@ -228,7 +212,7 @@ export class Hub {
228
212
*/
229
213
public captureEvent ( event : SentryEvent , hint ?: SentryEventHint ) : string {
230
214
const eventId = ( this . _lastEventId = uuid4 ( ) ) ;
231
- this . invokeClientAsync ( 'captureEvent' , event , {
215
+ this . invokeClient ( 'captureEvent' , event , {
232
216
...hint ,
233
217
event_id : eventId ,
234
218
} ) ;
0 commit comments