function drush_cmp_error

8.0.x drush.inc drush_cmp_error($error)
6.x drush.inc drush_cmp_error($error)
7.x drush.inc drush_cmp_error($error)
3.x drush.inc drush_cmp_error($error)
4.x drush.inc drush_cmp_error($error)
5.x drush.inc drush_cmp_error($error)
master drush.inc drush_cmp_error($error)

Check if a specific error status has been set.

Parameters

error: A text string identifying the error that has occurred.

Return value

TRUE if the specified error has been set, FALSE if not

Related topics

1 call to drush_cmp_error()
_drush_backend_integrate in includes/backend.inc
Integrate log messages and error statuses into the current process.

File

includes/drush.inc, line 1743
The drush API implementation and helpers.

Code

function drush_cmp_error($error) {
  $error_log = drush_get_error_log();

  if (is_numeric($error)) {
    $error = 'DRUSH_FRAMEWORK_ERROR';
  }

  return array_key_exists($error, $error_log);
}