commit 083e16c60511c535f4c1c589380b230f18c41cc1 Author: Matthew Radcliffe Date: Sat Aug 30 13:24:57 2014 -0400 Isuse #2181291 by mradcliffe: Change exception thrown based on default Connection::query(). diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php b/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php index bc1a8d9..8fb6234 100644 --- a/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php +++ b/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php @@ -12,6 +12,7 @@ use Drupal\Core\Database\DatabaseNotFoundException; use Drupal\Core\Database\StatementInterface; use Drupal\Core\Database\IntegrityConstraintViolationException; +use Drupal\Core\Database\DatabaseExceptionWrapper; /** * @addtogroup database @@ -147,6 +148,9 @@ public function query($query, array $args = array(), $options = array()) { if (substr($e->getCode(), -6, -3) == '23') { $e = new IntegrityConstraintViolationException($e->getMessage(), $e->getCode(), $e); } + else { + $e = new DatabaseExceptionWrapper($e->getMessage(), 0, $e); + } // Add additional debug information. if ($query instanceof StatementInterface) { $e->query_string = $stmt->getQueryString();