You are here

protected function DatabaseBackend::catchException in Drupal 9

Same name in this branch
  1. 9 core/lib/Drupal/Core/Flood/DatabaseBackend.php \Drupal\Core\Flood\DatabaseBackend::catchException()
  2. 9 core/lib/Drupal/Core/Cache/DatabaseBackend.php \Drupal\Core\Cache\DatabaseBackend::catchException()
Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Flood/DatabaseBackend.php \Drupal\Core\Flood\DatabaseBackend::catchException()

Act on an exception when flood 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 flood is stale and the exception needs to propagate.

Parameters

$e: The exception.

Throws

\Exception

3 calls to DatabaseBackend::catchException()
DatabaseBackend::clear in core/lib/Drupal/Core/Flood/DatabaseBackend.php
Makes the flood control mechanism forget an event for the current visitor.
DatabaseBackend::garbageCollection in core/lib/Drupal/Core/Flood/DatabaseBackend.php
Cleans up expired flood events. This method is called automatically on cron run.
DatabaseBackend::isAllowed in core/lib/Drupal/Core/Flood/DatabaseBackend.php
Checks whether a user is allowed to proceed with the specified event.

File

core/lib/Drupal/Core/Flood/DatabaseBackend.php, line 180

Class

DatabaseBackend
Defines the database flood backend. This is the default Drupal backend.

Namespace

Drupal\Core\Flood

Code

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