protected function DatabaseBackend::catchException

protected DatabaseBackend::catchException(\Exception $e, $table_name = NULL)

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

File

core/lib/Drupal/Core/Cache/DatabaseBackend.php, line 388

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

© 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!Cache!DatabaseBackend.php/function/DatabaseBackend::catchException/8.1.x