Skip to content

fix(nitro): Capture errors only through the Nitro error hook - #24952

Merged
nicohrubec merged 2 commits into
developfrom
feat/nitro-error-hook-capture
Oct 2, 2026
Merged

nicohrubec merged 2 commits into
developfrom
feat/nitro-error-hook-capture

Conversation

@nicohrubec

Copy link
Copy Markdown
Member

Capture errors through Nitro's error hook so ordinary thrown errors are reported once and 3xx/4xx HTTP errors stay filtered. The tracing channel continues recording span error status without sending a separate error event.

Adds E2E coverage for an explicitly thrown 400 and updates the standard error test to expect the hook event.

Fixes #24939

Co-Authored-By: OpenAI Codex <codex@openai.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f344b92. Configure here.

Comment thread dev-packages/e2e-tests/test-applications/nitro-3/tests/errors.test.ts Outdated
Co-Authored-By: OpenAI Codex <codex@openai.com>
@nicohrubec
nicohrubec marked this pull request as ready for review October 1, 2026 16:50
@nicohrubec
nicohrubec requested a review from a team as a code owner October 1, 2026 16:50
@nicohrubec
nicohrubec requested review from chargome, logaretm and s1gr1d and removed request for a team October 1, 2026 16:50
@nicohrubec
nicohrubec merged commit f555a14 into develop Oct 2, 2026
50 checks passed
@nicohrubec
nicohrubec deleted the feat/nitro-error-hook-capture branch October 2, 2026 07:06
nicohrubec added a commit that referenced this pull request Oct 2, 2026
)

Backport of: #24952

## Differences to the original PR

- The 400-error regression test waits for the flush endpoint's
transaction instead of a streamed span, matching v10's default trace
lifecycle.
- The standard error test checks the hook mechanism on the original
`Error` instead of the `HTTPError` wrapper, matching v10's mechanism
assignment within linked errors.

Fixes #24939

Co-authored-by: OpenAI Codex <codex@openai.com>
@github-actions github-actions Bot mentioned this pull request Oct 2, 2026
3 tasks done
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.

Nitro: Errors are reported twice

2 participants