You are here

function _features_drush_set_error in Features 6

Same name and namespace in other branches
  1. 7.2 features.drush.inc \_features_drush_set_error()
  2. 7 features.drush.inc \_features_drush_set_error()

Helper function to call drush_set_error().

Parameters

$feature: The string name of the feature.

$error: A text string identifying the type of error.

Return value

FALSE. See drush_set_error().

3 calls to _features_drush_set_error()
drush_features_add in ./features.drush.inc
Add a component to a features module.
drush_features_revert in ./features.drush.inc
Revert a feature to it's code definition.
drush_features_update in ./features.drush.inc
Update an existing feature module.

File

./features.drush.inc, line 642
Features module drush integration.

Code

function _features_drush_set_error($feature, $error = '') {
  $args = array(
    '!feature' => $feature,
  );
  switch ($error) {
    case 'FEATURES_FEATURE_NOT_ENABLED':
      $message = 'The feature !feature is not enabled.';
      break;
    default:
      $error = 'FEATURES_FEATURE_NOT_FOUND';
      $message = 'The feature !feature could not be found.';
  }
  return drush_set_error($error, dt($message, $args));
}