0
Q:

how to log bodyparser error

app.use(bodyParser.json())

app.use((err, req, res, next) => {
  if (err) {
    console.log('Invalid Request data', err)
    res.status(400).send('Invalid Request data')
  } else {
    next()
  }
})
0

New to Communities?

Join the community