protected function DatabaseCacheTagsChecksum::catchException

protected DatabaseCacheTagsChecksum::catchException(\Exception $e)

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

File

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

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

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