protected function DatabaseQueue::catchException

protected DatabaseQueue::catchException(\Exception $e)

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

Parameters

$e: The exception.

Throws

\Exception If the table exists the exception passed in is rethrown.

File

core/lib/Drupal/Core/Queue/DatabaseQueue.php, line 272

Class

DatabaseQueue
Default queue implementation.

Namespace

Drupal\Core\Queue

Code

protected function catchException(\Exception $e) {
  if ($this->connection->schema()->tableExists(static::TABLE_NAME)) {
    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!Queue!DatabaseQueue.php/function/DatabaseQueue::catchException/8.1.x