status + send on syntax error handler
This commit is contained in:
parent
361dd00e9d
commit
db8457af60
@ -267,7 +267,7 @@ function bootstrap(opts) {
|
||||
app.use(function(err, req, res, next) {
|
||||
if (err) {
|
||||
if (err.name === 'SyntaxError') {
|
||||
res.send({ errors: [err.name + ': ' + err.message] }, 400);
|
||||
res.status(400).json({ errors: [err.name + ': ' + err.message] });
|
||||
} else {
|
||||
next(err);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user