Drupal 7 db_error() equivalent?
The Drupal 7 database API piggy-backs straight onto PDO. It doesn't define its own exceptions, or messages; it actually doesn't even attempt to handle any exceptions, it leaves them for the caller to handle directly.

The most descriptive error message you can get is in the exception object.

catch (\PDOException $e) {
  $error = $e-&gt;getMessage();