Skip to content
Snippets Groups Projects
Commit 3d20ec65 authored by Lloyd Hilaiel's avatar Lloyd Hilaiel
Browse files

fix a missing non-object json response - issue #217

parent 61c55315
No related branches found
No related tags found
No related merge requests found
......@@ -137,7 +137,7 @@ app.use(function(req, resp, next) {
resp.json = function(obj) {
if (!obj || typeof obj !== 'object') {
logger.error("INTERNAL ERROR! *all* json responses must be objects");
throw "internal error";
return httputils.serverError(resp, "broken internal API implementation");
}
realRespJSON.call(resp, obj);
};
......
......@@ -245,7 +245,6 @@ exports.setup = function(options, app) {
wsapis[operation].validate = function(req,res,next) { next(); };
}
} catch(e) {
var msg = "error registering " + operation + " api: " + e;
logger.error(msg);
......
......@@ -25,7 +25,7 @@ exports.process = function(req, res) {
delete req.session.pendingAddition;
res.json({ status: 'complete' });
} else if (!req.session.pendingAddition) {
res.json('failed');
res.json({ status: 'failed' });
} else {
db.emailForVerificationSecret(req.session.pendingAddition, function (email) {
if (email) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment