Skip to content

Commit 53493ae

Browse files
committed
Event processors
1 parent 3e86557 commit 53493ae

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

packages/integrations/src/extraerrordata.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export class ExtraErrorData implements Integration {
3737
* @inheritDoc
3838
*/
3939
public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {
40-
addGlobalEventProcessor((event: Event, hint?: EventHint) => {
40+
addGlobalEventProcessor((event: Event, hint: EventHint) => {
4141
const self = getCurrentHub().getIntegration(ExtraErrorData);
4242
if (!self) {
4343
return event;
@@ -49,8 +49,8 @@ export class ExtraErrorData implements Integration {
4949
/**
5050
* Attaches extracted information from the Error object to extra field in the Event
5151
*/
52-
public enhanceEventWithErrorData(event: Event, hint?: EventHint): Event {
53-
if (!hint || !hint.originalException || !isError(hint.originalException)) {
52+
public enhanceEventWithErrorData(event: Event, hint: EventHint): Event {
53+
if (!hint.originalException || !isError(hint.originalException)) {
5454
return event;
5555
}
5656
const exceptionName = (hint.originalException as ExtendedError).name || hint.originalException.constructor.name;

packages/node/src/integrations/linkederrors.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class LinkedErrors implements Integration {
4343
* @inheritDoc
4444
*/
4545
public setupOnce(): void {
46-
addGlobalEventProcessor(async (event: Event, hint?: EventHint) => {
46+
addGlobalEventProcessor(async (event: Event, hint: EventHint) => {
4747
const hub = getCurrentHub();
4848
const self = hub.getIntegration(LinkedErrors);
4949
const client = hub.getClient<NodeClient>();
@@ -57,8 +57,8 @@ export class LinkedErrors implements Integration {
5757
/**
5858
* @inheritDoc
5959
*/
60-
private _handler(stackParser: StackParser, event: Event, hint?: EventHint): PromiseLike<Event> {
61-
if (!event.exception || !event.exception.values || !hint || !isInstanceOf(hint.originalException, Error)) {
60+
private _handler(stackParser: StackParser, event: Event, hint: EventHint): PromiseLike<Event> {
61+
if (!event.exception || !event.exception.values || !isInstanceOf(hint.originalException, Error)) {
6262
return resolvedSyncPromise(event);
6363
}
6464

packages/types/src/eventprocessor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ import { Event, EventHint } from './event';
88
*/
99
export interface EventProcessor {
1010
id?: string; // This field can't be named "name" because functions already have this field natively
11-
(event: Event, hint?: EventHint): PromiseLike<Event | null> | Event | null;
11+
(event: Event, hint: EventHint): PromiseLike<Event | null> | Event | null;
1212
}

0 commit comments

Comments
 (0)