You are here

public function BatchBuilder::setErrorMessage in Drupal 8

Same name and namespace in other branches
  1. 9 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()

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;
}