8 lines
156 B
JavaScript
8 lines
156 B
JavaScript
const catchAsync = (func) => {
|
|
return (req, res, next) => {
|
|
func(req, res, next).catch((error) => next(error));
|
|
};
|
|
};
|
|
|
|
module.exports = catchAsync;
|