express-async-errors
express-async-errors copied to clipboard
Express v5 support
This PR aims to address and close #28
Currently a WIP with the goal of preparing for the release of Express v5 which adds async error support to route/middleware handlers.
This package also introduces promise support for param handling re: #12, which is a feature, at the time of opening, not planned for the Express v5 release.
This PR attempts to preserve the features that users of this package enjoy, while allowing them to upgrade to Express v5.
I will get some eyes on this from Express folks before moving from draft PR to something ready to be merged 👍
There should also be an update made to the Readme here about upgrading to Express v5 which mentions that if users aren't using the promise based version of router.param
then they are safe to remove this package and upgrade straight to v5.
With https://github.com/pillarjs/router/pull/92 in the works, the course of this PR will likely change to make this library a no-op under v5, printing a message to let folks know that Express supports this functionality out of the box.
For folks interested in more color on Express v5's async/await handling, @jonchurch wrote up a nice description here: https://github.com/expressjs/express/issues/4256#issuecomment-619616708
Thanks @jonchurch !!