You are here

function _features_drush_set_error in Features 7

Same name and namespace in other branches
  1. 6 features.drush.inc \_features_drush_set_error()
  2. 7.2 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_export in ./features.drush.inc
Add a component to a features module, or create a new module with the selected components.
drush_features_revert in ./features.drush.inc
Revert a feature to it's code definition. Optionally accept a list of components to revert.
drush_features_update in ./features.drush.inc
Update an existing feature module.

File

./features.drush.inc, line 802
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;
    case 'FEATURES_COMPONENT_NOT_FOUND':
      $message = 'The given component !feature could not be found.';
      break;
    default:
      $error = 'FEATURES_FEATURE_NOT_FOUND';
      $message = 'The feature !feature could not be found.';
  }
  return drush_set_error($error, dt($message, $args));
}