protected function DatabaseBackend::catchException

Act on an exception when cache might be stale.

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

Parameters

$e: The exception.

string|null $table_name: The table name, defaults to $this->bin. Can be cache_tags.

8 calls to DatabaseBackend::catchException()
DatabaseBackend::deleteAll in drupal/core/lib/Drupal/Core/Cache/DatabaseBackend.php
Implements Drupal\Core\Cache\CacheBackendInterface::deleteAll().
DatabaseBackend::deleteMultiple in drupal/core/lib/Drupal/Core/Cache/DatabaseBackend.php
Implements Drupal\Core\Cache\CacheBackendInterface::deleteMultiple().
DatabaseBackend::deleteTags in drupal/core/lib/Drupal/Core/Cache/DatabaseBackend.php
Implements Drupal\Core\Cache\CacheBackendInterface::deleteTags().
DatabaseBackend::invalidateAll in drupal/core/lib/Drupal/Core/Cache/DatabaseBackend.php
Implements Drupal\Core\Cache\CacheBackendInterface::invalidateAll().
DatabaseBackend::invalidateMultiple in drupal/core/lib/Drupal/Core/Cache/DatabaseBackend.php
Implements Drupal\Core\Cache\CacheBackendInterface::invalideMultiple().

... See full list

File

drupal/core/lib/Drupal/Core/Cache/DatabaseBackend.php, line 457
Definition of Drupal\Core\Cache\DatabaseBackend.

Class

DatabaseBackend
Defines a default cache implementation.

Namespace

Drupal\Core\Cache

Code

protected function catchException(\Exception $e, $table_name = NULL) {
  if ($this->connection
    ->schema()
    ->tableExists($table_name ?: $this->bin)) {
    throw $e;
  }
}