You are here

function _features_drush_set_error in Features 7.2

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

Helper function to call drush_set_error().

Parameters

string $feature: The string name of the feature.

string $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
Drush command callback for 'features-export'.
drush_features_revert in ./features.drush.inc
Drush command callback for 'features-revert'.
drush_features_update in ./features.drush.inc
Drush command callback for 'features-update'.

File

./features.drush.inc, line 1139
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));
}