From 323be545abccb1cb877af648acedfb2d715ad0b2 Mon Sep 17 00:00:00 2001 From: reality Date: Sun, 15 Mar 2015 18:51:54 +0000 Subject: [PATCH] extract err --- modules/api/api.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/api/api.js b/modules/api/api.js index ecbe3b4..58b1767 100644 --- a/modules/api/api.js +++ b/modules/api/api.js @@ -51,8 +51,7 @@ var api = function(dbot) { if(callbackIndex != -1) { args[callbackIndex] = function() { body.data = Array.prototype.slice.call(arguments, 0); - console.log(body); - if(_.isObject(body.data) && _.has(body.data, 'err')) { + if(_.isObject(body.data[0]) && _.has(body.data[0], 'err')) { body.err = body.data.err; } res.json(body);