Error message

You are browsing documentation for drupal 7.x, which is not supported anymore. Read the updated version of this page for drupal 11.x (the latest version).

function DatabaseStatementPrefetch::throwPDOException

Throw a PDO Exception based on the last PDO error.

1 call to DatabaseStatementPrefetch::throwPDOException()
DatabaseStatementPrefetch::execute in includes/database/prefetch.inc
Executes a prepared statement.

File

includes/database/prefetch.inc, line 204

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

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