function ExceptionHandler::handleExecutionException

Same name in this branch
  1. 11.x core/modules/mysql/src/Driver/Database/mysql/ExceptionHandler.php \Drupal\mysql\Driver\Database\mysql\ExceptionHandler::handleExecutionException()
  2. 11.x core/lib/Drupal/Core/Database/ExceptionHandler.php \Drupal\Core\Database\ExceptionHandler::handleExecutionException()
Same name and namespace in other branches
  1. 9 core/modules/mysql/src/Driver/Database/mysql/ExceptionHandler.php \Drupal\mysql\Driver\Database\mysql\ExceptionHandler::handleExecutionException()
  2. 9 core/lib/Drupal/Core/Database/ExceptionHandler.php \Drupal\Core\Database\ExceptionHandler::handleExecutionException()
  3. 10 core/modules/mysql/src/Driver/Database/mysql/ExceptionHandler.php \Drupal\mysql\Driver\Database\mysql\ExceptionHandler::handleExecutionException()
  4. 10 core/lib/Drupal/Core/Database/ExceptionHandler.php \Drupal\Core\Database\ExceptionHandler::handleExecutionException()

Overrides ExceptionHandler::handleExecutionException

File

core/modules/mysqli/src/Driver/Database/mysqli/ExceptionHandler.php, line 18

Class

ExceptionHandler
MySQLi database exception handler class.

Namespace

Drupal\mysqli\Driver\Database\mysqli

Code

public function handleExecutionException(\Exception $exception, StatementInterface $statement, array $arguments = [], array $options = []) : void {
  // Close the client statement to release handles.
  if ($statement->hasClientStatement()) {
    $statement->getClientStatement()
      ->close();
  }
  if (!$exception instanceof \mysqli_sql_exception) {
    throw $exception;
  }
  $this->rethrowNormalizedException($exception, $exception->getSqlState(), $exception->getCode(), $statement->getQueryString(), $arguments);
}

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