extract err

This commit is contained in:
reality 2015-03-15 18:46:58 +00:00
parent b54774994b
commit 22c9a5e011

View File

@ -51,6 +51,9 @@ var api = function(dbot) {
if(callbackIndex != -1) { if(callbackIndex != -1) {
args[callbackIndex] = function() { args[callbackIndex] = function() {
body.data = Array.prototype.slice.call(arguments, 0); body.data = Array.prototype.slice.call(arguments, 0);
if(_.isObject(body.data) && _.has(body.data, 'err')) {
body.err = body.data.err;
}
res.json(body); res.json(body);
}; };
func.apply(null, args); func.apply(null, args);