1
1
import { ClientLike , EventHint , Exception , ExtendedError , Integration , SentryEvent } from '@sentry/types' ;
2
- import { isInstanceOf , SyncPromise } from '@sentry/utils' ;
2
+ import { isInstanceOf } from '@sentry/utils' ;
3
3
import { getExceptionFromError } from '@sentry/eventbuilder-node' ;
4
4
5
5
const DEFAULT_KEY = 'cause' ;
@@ -19,10 +19,10 @@ export class LinkedErrors implements Integration {
19
19
public install ( client : ClientLike ) : void {
20
20
client . addEventProcessor ( ( event : SentryEvent , hint ?: EventHint ) => {
21
21
if ( ! event . exception || ! event . exception . values || ! hint || ! isInstanceOf ( hint . originalException , Error ) ) {
22
- return SyncPromise . resolve ( event ) ;
22
+ return Promise . resolve ( event ) ;
23
23
}
24
24
25
- return new SyncPromise < SentryEvent > ( resolve => {
25
+ return new Promise ( resolve => {
26
26
this . _walkErrorTree ( hint . originalException as Error , this . _key )
27
27
. then ( ( linkedErrors : Exception [ ] ) => {
28
28
if ( event && event . exception && event . exception . values ) {
@@ -39,9 +39,9 @@ export class LinkedErrors implements Integration {
39
39
40
40
private _walkErrorTree ( error : ExtendedError , key : string , stack : Exception [ ] = [ ] ) : PromiseLike < Exception [ ] > {
41
41
if ( ! isInstanceOf ( error [ key ] , Error ) || stack . length + 1 >= this . _limit ) {
42
- return SyncPromise . resolve ( stack ) ;
42
+ return Promise . resolve ( stack ) ;
43
43
}
44
- return new SyncPromise < Exception [ ] > ( ( resolve , reject ) => {
44
+ return new Promise ( ( resolve , reject ) => {
45
45
getExceptionFromError ( error [ key ] )
46
46
. then ( ( exception : Exception ) => {
47
47
this . _walkErrorTree ( error [ key ] , key , [ exception , ...stack ] )
0 commit comments