Standardise API error response format

This commit is contained in:
Nick O'Leary
2015-03-30 14:16:04 +01:00
parent 7adefd6ee0
commit 2a8a885271
9 changed files with 24 additions and 26 deletions

View File

@@ -31,9 +31,8 @@ var needsPermission = auth.needsPermission;
var settings = require("../settings");
var errorHandler = function(err,req,res,next) {
//TODO: standardize json response
console.log(err.stack);
res.send(400,err.toString());
res.json(400,{message:err.toString()});
};
function init(adminApp,storage) {