UNPKG

@syngrisi/syngrisi

Version:
9 lines (7 loc) 221 B
const catchAsync = (fn) => (req, res, next) => { Promise.resolve(fn(req, res, next)).catch((err) => { log.error(err.stack || err.toString()); return next(err); }); }; module.exports = catchAsync;