You are here

protected function BatchStorage::catchException in Drupal 9

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

4 calls to BatchStorage::catchException()
BatchStorage::cleanup in core/lib/Drupal/Core/Batch/BatchStorage.php
Cleans up failed or old batches.
BatchStorage::delete in core/lib/Drupal/Core/Batch/BatchStorage.php
Deletes a batch.
BatchStorage::load in core/lib/Drupal/Core/Batch/BatchStorage.php
Loads a batch.
BatchStorage::update in core/lib/Drupal/Core/Batch/BatchStorage.php
Updates a batch.

File

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

Class

BatchStorage

Namespace

Drupal\Core\Batch

Code

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