Files
quicklanch-server/dist/app/utils/catch_async.js
T

12 lines
226 B
JavaScript
Raw Normal View History

const catchAsync = (fn) => {
return async (req, res, next) => {
try {
await fn(req, res, next);
}
catch (error) {
next(error);
}
};
};
export default catchAsync;