From db8457af60abdaf901add7f2ed4ba46d98d31e32 Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Thu, 17 Sep 2015 11:07:02 +0200 Subject: [PATCH] status + send on syntax error handler --- lib/cartodb/server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cartodb/server.js b/lib/cartodb/server.js index 82a4c6d0..2a9c67ae 100644 --- a/lib/cartodb/server.js +++ b/lib/cartodb/server.js @@ -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); }