Manimaran
Manimaran

Reputation: 405

Some times response not sending when sequelize error occur (Unhandled rejection SequelizeDatabaseError)

enter image description herewhen i pass wrong QueryParams value like minus value. occur Unhandled rejection SequelizeDatabaseError: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-8, 4' at line 1 that situation not get response from server

http://localhost:500/XXX/getXXX?currentPage=-1&numPerPage=4

Upvotes: 0

Views: 423

Answers (1)

Muthukumar
Muthukumar

Reputation: 9609

Most likely global error was not handled properly. Try adding it to your routes.

app.use(function(err, req, res, next) {
  console.error(err);
  res.status(500).send('internal server error');
})

Upvotes: 0

Related Questions