MultiUsersSalesSystem / utils /catchAsync.js
Mahmoud7456's picture
Upload 72 files
0330133 verified
Raw History Blame Contribute Delete
271 Bytes
/**
* Error handling wrapper for async route handlers
* Catches errors and passes them to Express error middleware
*/
export const catchAsync = (fn) => {
return (req, res, next) => {
fn(req, res, next).catch(next);
};
};
export default catchAsync;