/** * 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;