Skip to content

Commit 141f55f

Browse files
Turbo87kamilogorek
authored andcommitted
ref: browser/ember: Use withScope() instead of manually push/pop (#1689)
1 parent ad4c1eb commit 141f55f

File tree

1 file changed

+11
-11
lines changed
  • packages/browser/src/integrations/pluggable

1 file changed

+11
-11
lines changed

packages/browser/src/integrations/pluggable/ember.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,17 @@ export class Ember implements Integration {
5656
'error',
5757
(reason: any): void => {
5858
if (getCurrentHub().getIntegration(Ember)) {
59-
const scope = getCurrentHub().pushScope();
60-
if (reason instanceof Error) {
61-
scope.setExtra('context', 'Unhandled Promise error detected');
62-
this.addIntegrationToSdkInfo(scope);
63-
getCurrentHub().captureException(reason, { originalException: reason });
64-
} else {
65-
scope.setExtra('reason', reason);
66-
this.addIntegrationToSdkInfo(scope);
67-
captureMessage('Unhandled Promise error detected');
68-
}
69-
getCurrentHub().popScope();
59+
withScope(scope => {
60+
if (reason instanceof Error) {
61+
scope.setExtra('context', 'Unhandled Promise error detected');
62+
this.addIntegrationToSdkInfo(scope);
63+
getCurrentHub().captureException(reason, { originalException: reason });
64+
} else {
65+
scope.setExtra('reason', reason);
66+
this.addIntegrationToSdkInfo(scope);
67+
captureMessage('Unhandled Promise error detected');
68+
}
69+
});
7070
}
7171
},
7272
);

0 commit comments

Comments
 (0)