lib/qb.js
function _listen(qb) {
  qb.on('error', function (err, next) {
    qb.log.error(err)
    next()
  })

  qb.on('process', function (type, task, next) {
    try {
      qb._types[type](task, callback);
    } catch (err) {
      callback(err);
    }

    function callback(err) {
      next(err) // We don't pass errors through because that is not for "task failure" errors
      if (err) {
        qb.emit('fail', err, type, task, errcallback(qb));
      } else {
        qb.emit('finish', type, task, errcallback(qb));
      }
    }
  });
}
function _listen(qb) {
  qb.on('error', function (err, next) {
    qb.log.error(err)
    next()
  })

  qb.on('process', function (type, task, next) {
    try {
      qb._types[type](task, callback);
    } catch (err) {
      callback(err);
    }

    function callback(err) {
      next(err) // We don't pass errors through because that is not for "task failure" errors
      if (err) {
        qb.emit('fail', err, type, task, errcallback(qb));
      } else {
        qb.emit('finish', type, task, errcallback(qb));
      }
    }
  });
}
-- Helpers --