You are here

protected static function BatchProcessor::handleBatchError in Automatic Updates 8.2

Handles a batch job that finished with errors.

Parameters

array $results: The batch results.

2 calls to BatchProcessor::handleBatchError()
BatchProcessor::finishCommit in src/BatchProcessor.php
Finishes the commit batch job.
BatchProcessor::finishStage in src/BatchProcessor.php
Finishes the stage batch job.

File

src/BatchProcessor.php, line 174

Class

BatchProcessor
A batch processor for updates.

Namespace

Drupal\automatic_updates

Code

protected static function handleBatchError(array $results) : void {
  if (isset($results['errors'])) {
    foreach ($results['errors'] as $error) {
      \Drupal::messenger()
        ->addError($error);
    }
  }
  else {
    \Drupal::messenger()
      ->addError("Update error");
  }
}