not able to undestand the logic in try block
const validate = (Schema) => { return async (req, res, next) => { try { const parseBody = await Schema.parseAsync(req.body); req.body = parseBody; next() } catch (err) { console.log(err) const status = 422; const message = err.errors[0].message ; const error = { status, message, } next(error) // res.status(400).json({ msg: message}) } } } module.exports = […]