示例#1
0
文件: gulpfile.js 项目: dalgos/hr4R
 function (err, response, body) {
     if (err) {
         console.log(colors.red(ijson.parse(err).error));
     }
     else {
         console.log(colors.blue(ijson.parse(body).success));
     }
 });
 }, function (err, response, body) {
     if (err) {
         log.error(err);
         cb(err);
     }
     else {
         body = ijson.parse(body);
         var msg;
         if (msg = body.error) {
             log.error(msg);
             cb(msg);
         }
         else if (msg = body.success) {
             caches.blacklistedHandles.setValue(_.map(msg || [], function (handleObj) {
                 return handleObj.handle;
             }));  //set handles to models sent back from request
             cb(null);
         }
         else {
             cb(new Error('bad API response'));
         }
     }
 });