function DatabaseCacheTagsChecksum::catchException

Same name in other branches
  1. 9 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

2 calls to DatabaseCacheTagsChecksum::catchException()
DatabaseCacheTagsChecksum::doInvalidateTags in core/lib/Drupal/Core/Cache/DatabaseCacheTagsChecksum.php
Marks cache items with any of the specified tags as invalid.
DatabaseCacheTagsChecksum::getTagInvalidationCounts in core/lib/Drupal/Core/Cache/DatabaseCacheTagsChecksum.php
Fetches invalidation counts for cache tags.

File

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

Class

DatabaseCacheTagsChecksum
Cache tags invalidations checksum implementation that uses the database.

Namespace

Drupal\Core\Cache

Code

protected function catchException(\Exception $e) {
    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.