1
1
import { addGlobalEventProcessor , getCurrentHub } from '@sentry/core' ;
2
2
import { Event , EventHint , Exception , ExtendedError , Integration } from '@sentry/types' ;
3
- import { SyncPromise } from '@sentry/utils' ;
3
+ import { isInstanceOf , SyncPromise } from '@sentry/utils' ;
4
4
5
5
import { getExceptionFromError } from '../parsers' ;
6
6
@@ -53,12 +53,12 @@ export class LinkedErrors implements Integration {
53
53
* @inheritDoc
54
54
*/
55
55
public handler ( event : Event , hint ?: EventHint ) : PromiseLike < Event > {
56
- if ( ! event . exception || ! event . exception . values || ! hint || ! ( hint . originalException instanceof Error ) ) {
56
+ if ( ! event . exception || ! event . exception . values || ! hint || ! isInstanceOf ( hint . originalException , Error ) ) {
57
57
return SyncPromise . resolve ( event ) ;
58
58
}
59
59
60
60
return new SyncPromise < Event > ( resolve => {
61
- this . walkErrorTree ( hint . originalException as ExtendedError , this . _key )
61
+ this . walkErrorTree ( hint . originalException as Error , this . _key )
62
62
. then ( ( linkedErrors : Exception [ ] ) => {
63
63
if ( event && event . exception && event . exception . values ) {
64
64
event . exception . values = [ ...linkedErrors , ...event . exception . values ] ;
@@ -75,7 +75,7 @@ export class LinkedErrors implements Integration {
75
75
* @inheritDoc
76
76
*/
77
77
public walkErrorTree ( error : ExtendedError , key : string , stack : Exception [ ] = [ ] ) : PromiseLike < Exception [ ] > {
78
- if ( ! ( error [ key ] instanceof Error ) || stack . length + 1 >= this . _limit ) {
78
+ if ( ! isInstanceOf ( error [ key ] , Error ) || stack . length + 1 >= this . _limit ) {
79
79
return SyncPromise . resolve ( stack ) ;
80
80
}
81
81
return new SyncPromise < Exception [ ] > ( ( resolve , reject ) => {
0 commit comments