Skip to content

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

Merged
andreiborza merged 1 commit intodevelopfrom
ab/capture-underscore-error-eventid
Feb 6, 2026
Merged

fix(nextjs): Expose an event id when captureUnderscoreErrorException captures an exception#19185
andreiborza merged 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
Copy link
Member

@RulaKhaled RulaKhaled left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@andreiborza andreiborza merged commit 47e5709 into develop Feb 6, 2026
68 checks passed
@andreiborza andreiborza deleted the ab/capture-underscore-error-eventid branch February 6, 2026 10:32
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

2 participants

Comments