2021-05-10 15:47:26 +00:00
|
|
|
function asyncWrapper(foo) {
|
|
|
|
return function (req, res, next) {
|
2021-10-21 22:42:27 +00:00
|
|
|
return Promise.resolve(foo(req, res, next)).catch(next);
|
|
|
|
};
|
2021-05-10 15:47:26 +00:00
|
|
|
}
|
|
|
|
|
2021-10-21 22:42:27 +00:00
|
|
|
module.exports = asyncWrapper;
|