Skip to content

Commit 3d3dd2b

Browse files
committed
port addBreadcrumb
1 parent 99c9af0 commit 3d3dd2b

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

packages/hub/src/exports.ts

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

33
import { getCurrentHub, Hub } from './hub';
44
import { Scope } from './scope';
@@ -65,3 +65,15 @@ export function captureEvent(event: Event): ReturnType<Hub['captureEvent']> {
6565
export function configureScope(callback: (scope: Scope) => void): ReturnType<Hub['configureScope']> {
6666
return getCurrentHub().configureScope(callback);
6767
}
68+
69+
/**
70+
* Records a new breadcrumb which will be attached to future events.
71+
*
72+
* Breadcrumbs will be added to subsequent events to provide more context on
73+
* user's actions prior to an error or crash.
74+
*
75+
* @param breadcrumb The breadcrumb to record.
76+
*/
77+
export function addBreadcrumb(breadcrumb: Breadcrumb): ReturnType<Hub['addBreadcrumb']> {
78+
return getCurrentHub().addBreadcrumb(breadcrumb);
79+
}

packages/minimal/src/index.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +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-
* Records a new breadcrumb which will be attached to future events.
34-
*
35-
* Breadcrumbs will be added to subsequent events to provide more context on
36-
* user's actions prior to an error or crash.
37-
*
38-
* @param breadcrumb The breadcrumb to record.
39-
*/
40-
export function addBreadcrumb(breadcrumb: Breadcrumb): void {
41-
callOnHub<void>('addBreadcrumb', breadcrumb);
42-
}
43-
4432
/**
4533
* Sets context data with the given name.
4634
* @param name of the context

0 commit comments

Comments
 (0)