function BatchStorage::catchException

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

Act on an exception when batch might be stale.

If the table does not yet exist, that's fine, but if the table exists and yet the query failed, then the batch is stale and the exception needs to propagate.

Parameters

$e: The exception.

Throws

\Exception

File

core/lib/Drupal/Core/Batch/BatchStorage.php, line 194

Class

BatchStorage

Namespace

Drupal\Core\Batch

Code

protected function catchException(\Exception $e) {
  if ($this->connection
    ->schema()
    ->tableExists(static::TABLE_NAME)) {
    throw $e;
  }
}

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