function BatchBuilder::setErrorMessage

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Batch/BatchBuilder.php \Drupal\Core\Batch\BatchBuilder::setErrorMessage()
  2. 10 core/lib/Drupal/Core/Batch/BatchBuilder.php \Drupal\Core\Batch\BatchBuilder::setErrorMessage()
  3. 11.x core/lib/Drupal/Core/Batch/BatchBuilder.php \Drupal\Core\Batch\BatchBuilder::setErrorMessage()

Sets the message to display if an error occurs while processing.

Defaults to 'An error has occurred.'.

Parameters

string|\Drupal\Core\StringTranslation\TranslatableMarkup $message: The text to display.

Return value

$this

File

core/lib/Drupal/Core/Batch/BatchBuilder.php, line 197

Class

BatchBuilder
Builds an array for a batch process.

Namespace

Drupal\Core\Batch

Code

public function setErrorMessage($message) {
    $this->errorMessage = $message;
    return $this;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.