@@ -175,7 +175,7 @@ export class ReplayContainer implements ReplayContainerInterface {
175
175
176
176
// If there is no session, then something bad has happened - can't continue
177
177
if ( ! this . session ) {
178
- this . handleException ( new Error ( 'No session found' ) ) ;
178
+ this . _handleException ( new Error ( 'No session found' ) ) ;
179
179
return ;
180
180
}
181
181
@@ -222,7 +222,7 @@ export class ReplayContainer implements ReplayContainerInterface {
222
222
emit : this . _handleRecordingEmit ,
223
223
} ) ;
224
224
} catch ( err ) {
225
- this . handleException ( err ) ;
225
+ this . _handleException ( err ) ;
226
226
}
227
227
}
228
228
@@ -252,7 +252,7 @@ export class ReplayContainer implements ReplayContainerInterface {
252
252
this . eventBuffer ?. destroy ( ) ;
253
253
this . eventBuffer = null ;
254
254
} catch ( err ) {
255
- this . handleException ( err ) ;
255
+ this . _handleException ( err ) ;
256
256
}
257
257
}
258
258
@@ -269,7 +269,7 @@ export class ReplayContainer implements ReplayContainerInterface {
269
269
this . _stopRecording = undefined ;
270
270
}
271
271
} catch ( err ) {
272
- this . handleException ( err ) ;
272
+ this . _handleException ( err ) ;
273
273
}
274
274
}
275
275
@@ -284,15 +284,6 @@ export class ReplayContainer implements ReplayContainerInterface {
284
284
this . startRecording ( ) ;
285
285
}
286
286
287
- /** A wrapper to conditionally capture exceptions. */
288
- public handleException ( error : unknown ) : void {
289
- __DEBUG_BUILD__ && logger . error ( '[Replay]' , error ) ;
290
-
291
- if ( __DEBUG_BUILD__ && this . _options . _experiments && this . _options . _experiments . captureExceptions ) {
292
- captureException ( error ) ;
293
- }
294
- }
295
-
296
287
/**
297
288
* We want to batch uploads of replay events. Save events only if
298
289
* `<flushMinDelay>` milliseconds have elapsed since the last event
@@ -360,6 +351,15 @@ export class ReplayContainer implements ReplayContainerInterface {
360
351
return this . _debouncedFlush . flush ( ) as Promise < void > ;
361
352
}
362
353
354
+ /** A wrapper to conditionally capture exceptions. */
355
+ private _handleException ( error : unknown ) : void {
356
+ __DEBUG_BUILD__ && logger . error ( '[Replay]' , error ) ;
357
+
358
+ if ( __DEBUG_BUILD__ && this . _options . _experiments && this . _options . _experiments . captureExceptions ) {
359
+ captureException ( error ) ;
360
+ }
361
+ }
362
+
363
363
/**
364
364
* Loads a session from storage, or creates a new one if it does not exist or
365
365
* is expired.
@@ -434,7 +434,7 @@ export class ReplayContainer implements ReplayContainerInterface {
434
434
this . _hasInitializedCoreListeners = true ;
435
435
}
436
436
} catch ( err ) {
437
- this . handleException ( err ) ;
437
+ this . _handleException ( err ) ;
438
438
}
439
439
440
440
// _performanceObserver //
@@ -462,7 +462,7 @@ export class ReplayContainer implements ReplayContainerInterface {
462
462
this . _performanceObserver = null ;
463
463
}
464
464
} catch ( err ) {
465
- this . handleException ( err ) ;
465
+ this . _handleException ( err ) ;
466
466
}
467
467
}
468
468
@@ -838,7 +838,7 @@ export class ReplayContainer implements ReplayContainerInterface {
838
838
eventContext,
839
839
} ) ;
840
840
} catch ( err ) {
841
- this . handleException ( err ) ;
841
+ this . _handleException ( err ) ;
842
842
}
843
843
}
844
844
@@ -1031,7 +1031,7 @@ export class ReplayContainer implements ReplayContainerInterface {
1031
1031
setContext ( 'Replays' , {
1032
1032
_retryCount : this . _retryCount ,
1033
1033
} ) ;
1034
- this . handleException ( err ) ;
1034
+ this . _handleException ( err ) ;
1035
1035
1036
1036
// If an error happened here, it's likely that uploading the attachment
1037
1037
// failed, we'll can retry with the same events payload
0 commit comments