function DatabaseCacheTagsChecksum::catchException

Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/Cache/DatabaseCacheTagsChecksum.php \Drupal\Core\Cache\DatabaseCacheTagsChecksum::catchException()

Act on an exception when cache might be stale.

If the {cachetags} 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

\Exception $e: The exception.

Throws

\Exception

Deprecated

in drupal:9.3.0 and is removed from drupal:10.0.0. There is no replacement.

See also

https://www.drupal.org/node/3243014

File

core/lib/Drupal/Core/Cache/DatabaseCacheTagsChecksum.php, line 137

Class

DatabaseCacheTagsChecksum
Cache tags invalidations checksum implementation that uses the database.

Namespace

Drupal\Core\Cache

Code

protected function catchException(\Exception $e) {
    @trigger_error('\\Drupal\\Core\\Cache\\DatabaseCacheTagsChecksum::catchException is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. There is no replacement. See https://www.drupal.org/node/3243014', E_USER_DEPRECATED);
    if ($this->connection
        ->schema()
        ->tableExists('cachetags')) {
        throw $e;
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.