Skip to content

Commit b5bce40

Browse files
Turbo87kamilogorek
authored andcommitted
integrations/ember: Remove unnecessary _addIntegrationToSdkInfo() method
The Ember integration is already listed in the `integrations` array, so there is no need to add `ember` a second time.
1 parent bc4cb71 commit b5bce40

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

packages/integrations/src/ember.ts

+2-24
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Event, EventProcessor, Hub, Integration, Scope } from '@sentry/types';
1+
import { EventProcessor, Hub, Integration } from '@sentry/types';
22
import { getGlobalObject } from '@sentry/utils';
33

44
/** JSDoc */
@@ -40,10 +40,7 @@ export class Ember implements Integration {
4040

4141
this._Ember.onerror = (error: Error): void => {
4242
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 });
4744
}
4845

4946
if (typeof oldOnError === 'function') {
@@ -60,33 +57,14 @@ export class Ember implements Integration {
6057
getCurrentHub().withScope(scope => {
6158
if (reason instanceof Error) {
6259
scope.setExtra('context', 'Unhandled Promise error detected');
63-
this._addIntegrationToSdkInfo(scope);
6460
getCurrentHub().captureException(reason, { originalException: reason });
6561
} else {
6662
scope.setExtra('reason', reason);
67-
this._addIntegrationToSdkInfo(scope);
6863
getCurrentHub().captureMessage('Unhandled Promise error detected');
6964
}
7065
});
7166
}
7267
},
7368
);
7469
}
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-
}
9270
}

0 commit comments

Comments
 (0)