lib/connection.js
function handleResponse(connection, err, res, cb) {
  runAfterHooks(connection, err, res, function (errFromHooks) {
    if(errFromHooks) {
      return cb(errFromHooks, null);
    } else if (res === undefined) {
      cb(err, null);
    } else {
      cb(err, res.body);
    }
  });
}
function handleResponse(connection, err, res, cb) {
  runAfterHooks(connection, err, res, function (errFromHooks) {
    if(errFromHooks) {
      return cb(errFromHooks, null);
    } else if (res === undefined) {
      cb(err, null);
    } else {
      cb(err, res.body);
    }
  });
}
function handleResponse ( connection , err , res , cb ) { runAfterHooks ( connection , err , res , function ( errFromHooks ) { if ( errFromHooks ) { return cb ( errFromHooks , null ) ; } else if ( res === undefined ) { cb ( err , null ) ; } else { cb ( err , res . body ) ; } } ) ; }
Handle SuperAgent HTTP Response. Calls hook functions followed by Waterline callback.
@param {Object} connection - connection configuration object
@param {Error} err - response error object
@param {Response} res - SuperAgent HTTP Response object
@param {Function} cb - function to call with query results.
Handle SuperAgent HTTP Response . Calls hook functions followed by Waterline callback .