You are here

protected function DatabaseRawBackend::catchException in Supercache 8

Same name and namespace in other branches
  1. 2.0.x src/Cache/DatabaseRawBackend.php \Drupal\supercache\Cache\DatabaseRawBackend::catchException()

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

Parameters

$e: The exception.

string|null $table_name: The table name. Defaults to $this->bin.

Throws

\Exception

3 calls to DatabaseRawBackend::catchException()
DatabaseRawBackend::deleteAll in src/Cache/DatabaseRawBackend.php
Deletes all cache items in a bin.
DatabaseRawBackend::deleteMultiple in src/Cache/DatabaseRawBackend.php
Deletes multiple items from the cache.
DatabaseRawBackend::removeBin in src/Cache/DatabaseRawBackend.php
Remove a cache bin.

File

src/Cache/DatabaseRawBackend.php, line 498
Contains \Drupal\supercache\Cache\DatabaseRawBackend.

Class

DatabaseRawBackend
Defines a default cache implementation.

Namespace

Drupal\supercache\Cache

Code

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