Files
Exchange/server/middlewares/tryCatch.ts
2025-11-07 22:24:40 +01:00

13 lines
206 B
TypeScript
Executable File

export default function tryCatch (cb) {
return async (req, res, next) => {
try {
await cb(req, res, next)
// next()
} catch (err) {
console.log(err)
next(err)
}
}
}