unjs / nitro

Next Generation Server Toolkit. Create web servers with everything you need and deploy them wherever you prefer.
https://nitro.unjs.io
MIT License
5.89k stars 496 forks source link

fix: only hide message of unhandled errors in prod #2619

Closed pi0 closed 2 months ago

pi0 commented 2 months ago

Fix regression of https://github.com/unjs/nitro/pull/2591 that hides messages of fatal: true errors.

Context: As pointed out in https://github.com/nuxt/nuxt/pull/28156#discussion_r1679720615, the current assumption was that fatal can be also used by user-thrown errors.

In the future, we might introduce a new internal flag to h3 errors to clearly separate internal and user errors from each other and keep (internal) fatal also private.