File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed
packages/browser/src/integrations Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 8
8
StackTrace as TraceKitStackTrace ,
9
9
subscribe ,
10
10
} from '../tracekit' ;
11
+ import { shouldIgnoreOnError } from './helpers' ;
11
12
12
13
/** Global handlers */
13
14
export class GlobalHandlers implements Integration {
@@ -43,6 +44,9 @@ export class GlobalHandlers implements Integration {
43
44
// 9: " foo();"
44
45
// 10: " }"
45
46
// ]
47
+ if ( shouldIgnoreOnError ( ) ) {
48
+ return ;
49
+ }
46
50
captureEvent ( this . eventFromGlobalHandler ( stack ) ) ;
47
51
} ) ;
48
52
Original file line number Diff line number Diff line change 1
1
import { getCurrentHub } from '@sentry/hub' ;
2
- import { SentryEvent , SentryWrappedFunction } from '@sentry/types' ;
2
+ import { Mechanism , SentryEvent , SentryWrappedFunction } from '@sentry/types' ;
3
3
import { isFunction } from '@sentry/utils/is' ;
4
4
import { htmlTreeAsString } from '@sentry/utils/misc' ;
5
5
6
6
const debounceDuration : number = 1000 ;
7
7
let keypressTimeout : number | undefined ;
8
8
let lastCapturedEvent : Event | undefined ;
9
- let ignoreOnError : number = - 1 ;
10
-
11
- // TODO: Fix `ignoreNextOnError`. Just temporary build fix for unused variable
12
- ignoreOnError = ignoreOnError + 1 ;
9
+ let ignoreOnError : number = 0 ;
13
10
11
+ /** JSDoc */
12
+ export function shouldIgnoreOnError ( ) : boolean {
13
+ return ignoreOnError > 0 ;
14
+ }
14
15
/** JSDoc */
15
16
export function ignoreNextOnError ( ) : void {
16
17
// onerror should trigger before setTimeout
You can’t perform that action at this time.
0 commit comments