Open
Description
Unfortunately, it's becoming increasingly common that errors are used as part of normal control flow.
AbortController
throws anAbortError
as part of cancellation logic.- A lot of web frameworks use throwing errors as part of request response logic using e.g. https://www.npmjs.com/package/http-errors. Hence, a normal 404 response can have nontrivial overhead due to to creating and throwing an error instead of simply doing
res.statusCode = 404; res.end(); return;
. - Web specs use throwing errors as a normal flow control mechanism (e.g. WebStreams)
Hence the current state of constructing errors in Node is not optimal. The errors are heavily enriched with lots of helpful information, however at a huge performance cost. We need to investigate what can be done to improve this and discuss possible compromises.
Metadata
Assignees
Labels
No labels