Skip to content

Commit f0cde98

Browse files
committed
fix(core): Prevent infinite recursion in event processing for internal exceptions
1 parent e0e72ee commit f0cde98

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/core/src/utils/prepareEvent.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { addExceptionMechanism, uuid4 } from './misc';
1111
import { normalize } from './normalize';
1212
import { applyScopeDataToEvent, getCombinedScopeData } from './scopeData';
1313
import { truncate } from './string';
14+
import { resolvedSyncPromise } from './syncpromise';
1415
import { dateTimestampInSeconds } from './time';
1516

1617
/**
@@ -93,7 +94,11 @@ export function prepareEvent(
9394
...data.eventProcessors,
9495
];
9596

96-
const result = notifyEventProcessors(eventProcessors, prepared, hint);
97+
// Skip event processors for internal exceptions to prevent recursion
98+
const isInternalException = hint.data && (hint.data as { __sentry__: boolean }).__sentry__ === true;
99+
const result = isInternalException
100+
? resolvedSyncPromise(prepared)
101+
: notifyEventProcessors(eventProcessors, prepared, hint);
97102

98103
return result.then(evt => {
99104
if (evt) {

0 commit comments

Comments
 (0)