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