Closed hillac closed 1 month ago
router.js
第487行
const out = callback(req, res, next); if(out instanceof Promise) { out.catch(err => { throw err; }); }
改为
callback.constructor.name == "AsyncFunction" ? await callback(req, res, next) : callback(req, res, next);
There's now an option to support async errors: app.set('catch async errors', true)
in 1.3.0
Any chance you could support handling errors in async handlers? I use express-async-errors with express to avoid the ugly try catch next block in every handler. It would obviously have to be in an option since it's not normal express behavior.