W3cubDocs

/Drupal 8

protected function DatabaseBackend::catchException

protected DatabaseBackend::catchException(\Exception $e)

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

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

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Flood!DatabaseBackend.php/function/DatabaseBackend::catchException/8.1.x