Skip to content

fix: make error handlers consistent with h3#4055

Draft
pi0 wants to merge 4 commits intomainfrom
fix/errs
Draft

fix: make error handlers consistent with h3#4055
pi0 wants to merge 4 commits intomainfrom
fix/errs

Conversation

@pi0
Copy link
Member

@pi0 pi0 commented Feb 24, 2026

This PR makes nitro default error handlers consistent and supports H3 error object features + adds tests to make sure they work in all presets and dev.

  • Respecting custom error response headers
  • Respecting custom error response body/data (toJSON implemented by HTTPError)
  • Infer unhandled (if not set) by checking HTTPError.isError (same behavior as H3)
  • Removed extra default CSP headers (json should not be loaded as source)
  • Removed extra url key in response body
  • Avoid duplicate console.error (H3 already console logs unhandled errors)

@vercel
Copy link

vercel bot commented Feb 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nitro.build Ready Ready Preview, Comment Feb 27, 2026 6:17pm

Request Review

@coderabbitai
Copy link

coderabbitai bot commented Feb 24, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/errs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant