Skip to content

fix(nextjs): Expose an event id when captureUnderscoreErrorException captures an exception#19185

Open
andreiborza wants to merge 1 commit intodevelopfrom
ab/capture-underscore-error-eventid
Open

fix(nextjs): Expose an event id when captureUnderscoreErrorException captures an exception#19185
andreiborza wants to merge 1 commit intodevelopfrom
ab/capture-underscore-error-eventid

Conversation

@andreiborza
Copy link
Member

captureException returns an event id that can be used for further logging and exposing it to users.

captureUnderscoreErrorException uses captureException under the hood but swallows the underlying event id if the error ends up being captured.

We also have Sentry.lastEventId() which could be used in the case the event was actually captured, however, in the case that captureUnderscoreErrorException does not call captureException, Sentry.lastEventId() might still return a previously attained id, misleading users.

This PR surfaces the underlying event id, if an event was captured and resolves in undefined otherwise.

Closes: #19166

…` captures

an exception

`captureException` returns an event id that can be used for further logging and
exposing it to users.

`captureUnderscoreErrorException` uses `captureException` under the hood but
swallows the underlying event id if the error ends up being captured.

We also have `Sentry.lastEventId()` which could be used in the case the event was
actually captured, however, in the case that `captureUnderscoreErrorException`
does not call `captureException`, `Sentry.lastEventId()` might still return a
previously attained id, misleading users.

This PR surfaces the underlying event id, if an event was captured and resolves
in undefined otherwise.

Closes: #19166
@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

Codecov Results 📊


Generated by Codecov Action

@andreiborza andreiborza requested a review from JPeer264 February 5, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

captureUnderscoreErrorException should return the event ID like captureException

1 participant