1.20.x prefetch.inc protected DatabaseStatementPrefetch::throwPDOException()

Throw a PDO Exception based on the last PDO error.

File

includes/database/prefetch.inc, line 201
Database interface code for engines that need complete control over their result sets.

Class

DatabaseStatementPrefetch
An implementation of DatabaseStatementInterface that prefetches all data.

Code

protected function throwPDOException() {
  $error_info = $this->dbh->errorInfo();
  // We rebuild a message formatted in the same way as PDO.
  $exception = new PDOException("SQLSTATE[" . $error_info[0] . "]: General error " . $error_info[1] . ": " . $error_info[2]);
  $exception->errorInfo = $error_info;
  throw $exception;
}