Question: I have the below middleware validating the input with joi, when it catches an issue it does send back the status of 400 but I cant see the err,details in the chrome network tab. I have tried .send and .json

```
static validateResendEmail = async (req: Request, res: Response, next: NextFunction) => {
    const schema = Joi.object().keys({
      jwtToken: Joi.string().trim().required(),
    });
    const jwtToken = req.body.jwtToken;
    Joi.validate({ jwtToken }, schema, (err, val) => {
      if (!err) {
        req.body = val;
        next();
      } else res.status(400).send(err.details);
    });
  };

```

Answer: 
```
res.status(400).send({error: err.details});

```

it needs JSON format inside of send()
```
  var data = req.body;
cosnt schema = Joi.object().keys({
jwtToken: Joi.string().trim().required()
});

Joi.validate(data, schema, (error, value) => {
if(error) {
  res.status(400).json({
    "msg": error.message
  });
}

```

Try this!