Skip to content

Commit 091524b

Browse files
committed
port captureEvent
1 parent b4b7221 commit 091524b

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

packages/hub/src/exports.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CaptureContext, Hub, Severity, SeverityLevel } from '@sentry/types';
1+
import { CaptureContext, Event, Hub, Severity, SeverityLevel } from '@sentry/types';
22

33
import { getCurrentHub } from './hub';
44

@@ -46,3 +46,13 @@ export function captureMessage(
4646
const context = typeof captureContext !== 'string' ? { captureContext } : undefined;
4747
return getCurrentHub().captureMessage(message, level, context);
4848
}
49+
50+
/**
51+
* Captures a manually created event and sends it to Sentry.
52+
*
53+
* @param event The event to send to Sentry.
54+
* @returns The generated eventId.
55+
*/
56+
export function captureEvent(event: Event): string {
57+
return getCurrentHub().captureEvent(event);
58+
}

packages/minimal/src/index.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,6 @@ function callOnHub<T>(method: string, ...args: any[]): T {
2929
throw new Error(`No hub defined or ${method} was not found on the hub, please open a bug report.`);
3030
}
3131

32-
/**
33-
* Captures a manually created event and sends it to Sentry.
34-
*
35-
* @param event The event to send to Sentry.
36-
* @returns The generated eventId.
37-
*/
38-
export function captureEvent(event: Event): string {
39-
return callOnHub('captureEvent', event);
40-
}
41-
4232
/**
4333
* Callback to set context information onto the scope.
4434
* @param callback Callback function that receives Scope.

0 commit comments

Comments
 (0)