Skip to content

Commit 9078131

Browse files
committed
ref(core): Skip hub in top level captureXXX methods
Directly call these on `getCurrentScope()` instead.
1 parent dc5383d commit 9078131

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

packages/core/src/exports.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ export function captureException(
4141
exception: any,
4242
hint?: ExclusiveEventHintOrCaptureContext,
4343
): string {
44-
// eslint-disable-next-line deprecation/deprecation
45-
return getCurrentHub().captureException(exception, parseEventHintOrCaptureContext(hint));
44+
return getCurrentScope().captureException(exception, parseEventHintOrCaptureContext(hint));
4645
}
4746

4847
/**
@@ -57,8 +56,7 @@ export function captureMessage(message: string, captureContext?: CaptureContext
5756
// arity of the `captureMessage(message, level)` method.
5857
const level = typeof captureContext === 'string' ? captureContext : undefined;
5958
const context = typeof captureContext !== 'string' ? { captureContext } : undefined;
60-
// eslint-disable-next-line deprecation/deprecation
61-
return getCurrentHub().captureMessage(message, level, context);
59+
return getCurrentScope().captureMessage(message, level, context);
6260
}
6361

6462
/**
@@ -69,8 +67,7 @@ export function captureMessage(message: string, captureContext?: CaptureContext
6967
* @returns the id of the captured event.
7068
*/
7169
export function captureEvent(event: Event, hint?: EventHint): string {
72-
// eslint-disable-next-line deprecation/deprecation
73-
return getCurrentHub().captureEvent(event, hint);
70+
return getCurrentScope().captureEvent(event, hint);
7471
}
7572

7673
/**

0 commit comments

Comments
 (0)