index.js
function _handleErr (err, callback) {
  if (callback) {
    return callback(err);
  } else if (promisesExist) {
    return Promise.reject(err);
  } else {
    throw new Error(err);
  }
}
function _handleErr (err, callback) {
  if (callback) {
    return callback(err);
  } else if (promisesExist) {
    return Promise.reject(err);
  } else {
    throw new Error(err);
  }
}
function _handleErr ( err , callback ) { if ( callback ) { return callback ( err ) ; } else if ( promisesExist ) { return Promise . reject ( err ) ; } else { throw new Error ( err ) ; } }
Error handler that supports promises and callbacks
@param err {String} - Error message
@param callback
Error handler that supports promises and callbacks