Skip to content

Commit d6b3b54

Browse files
committed
ref(node): Remove raven-node backward-compat code
Removes functionality around syncing context from domain.
1 parent 91f2634 commit d6b3b54

File tree

1 file changed

+8
-29
lines changed

1 file changed

+8
-29
lines changed

packages/node/src/integrations/onunhandledrejection.ts

+8-29
Original file line numberDiff line numberDiff line change
@@ -46,36 +46,15 @@ export class OnUnhandledRejection implements Integration {
4646
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
4747
public sendUnhandledPromise(reason: any, promise: any): void {
4848
const hub = getCurrentHub();
49-
50-
if (!hub.getIntegration(OnUnhandledRejection)) {
51-
this._handleRejection(reason);
52-
return;
53-
}
54-
55-
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
56-
const context = (promise.domain && promise.domain.sentryContext) || {};
57-
58-
hub.withScope((scope: Scope) => {
59-
scope.setExtra('unhandledPromiseRejection', true);
60-
61-
// Preserve backwards compatibility with raven-node for now
62-
if (context.user) {
63-
scope.setUser(context.user);
64-
}
65-
if (context.tags) {
66-
scope.setTags(context.tags);
67-
}
68-
if (context.extra) {
69-
scope.setExtras(context.extra);
70-
}
71-
72-
hub.captureException(reason, {
73-
originalException: promise,
74-
data: { mechanism: { handled: false, type: 'onunhandledrejection' } },
49+
if (hub.getIntegration(OnUnhandledRejection)) {
50+
hub.withScope((scope: Scope) => {
51+
scope.setExtra('unhandledPromiseRejection', true);
52+
hub.captureException(reason, {
53+
originalException: promise,
54+
data: { mechanism: { handled: false, type: 'onunhandledrejection' } },
55+
});
7556
});
76-
});
77-
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
78-
57+
}
7958
this._handleRejection(reason);
8059
}
8160

0 commit comments

Comments
 (0)