1
- import { Event , EventProcessor , Hub , Integration , Scope } from '@sentry/types' ;
1
+ import { EventProcessor , Hub , Integration } from '@sentry/types' ;
2
2
import { getGlobalObject } from '@sentry/utils' ;
3
3
4
4
/** JSDoc */
@@ -40,10 +40,7 @@ export class Ember implements Integration {
40
40
41
41
this . _Ember . onerror = ( error : Error ) : void => {
42
42
if ( getCurrentHub ( ) . getIntegration ( Ember ) ) {
43
- getCurrentHub ( ) . withScope ( scope => {
44
- this . _addIntegrationToSdkInfo ( scope ) ;
45
- getCurrentHub ( ) . captureException ( error , { originalException : error } ) ;
46
- } ) ;
43
+ getCurrentHub ( ) . captureException ( error , { originalException : error } ) ;
47
44
}
48
45
49
46
if ( typeof oldOnError === 'function' ) {
@@ -60,33 +57,14 @@ export class Ember implements Integration {
60
57
getCurrentHub ( ) . withScope ( scope => {
61
58
if ( reason instanceof Error ) {
62
59
scope . setExtra ( 'context' , 'Unhandled Promise error detected' ) ;
63
- this . _addIntegrationToSdkInfo ( scope ) ;
64
60
getCurrentHub ( ) . captureException ( reason , { originalException : reason } ) ;
65
61
} else {
66
62
scope . setExtra ( 'reason' , reason ) ;
67
- this . _addIntegrationToSdkInfo ( scope ) ;
68
63
getCurrentHub ( ) . captureMessage ( 'Unhandled Promise error detected' ) ;
69
64
}
70
65
} ) ;
71
66
}
72
67
} ,
73
68
) ;
74
69
}
75
-
76
- /**
77
- * Appends SDK integrations
78
- * @param scope The scope currently used.
79
- */
80
- private _addIntegrationToSdkInfo ( scope : Scope ) : void {
81
- scope . addEventProcessor ( ( event : Event ) => {
82
- if ( event . sdk ) {
83
- const integrations = event . sdk . integrations || [ ] ;
84
- event . sdk = {
85
- ...event . sdk ,
86
- integrations : [ ...integrations , 'ember' ] ,
87
- } ;
88
- }
89
- return event ;
90
- } ) ;
91
- }
92
70
}
0 commit comments