replaced all stop callbacks with customError callbacks. Fixes #270

This commit is contained in:
Peter 'Pita' Martischka 2011-12-10 16:46:47 +01:00
parent 22fd5ae33d
commit 6684d6ed52
7 changed files with 59 additions and 38 deletions

View file

@ -115,9 +115,9 @@ exports.handle = function(functionName, fields, req, res)
res.send({code: 0, message: "ok", data: data});
}
// parameters were wrong and the api stopped execution, pass the error
else if(err.stop)
else if(err.name == "apierror")
{
res.send({code: 1, message: err.stop, data: null});
res.send({code: 1, message: err.message, data: null});
}
//an unkown error happend
else