diff --git a/src/Drivers/Pdo/Connection.php b/src/Drivers/Pdo/Connection.php index 8733411e..bde1af79 100644 --- a/src/Drivers/Pdo/Connection.php +++ b/src/Drivers/Pdo/Connection.php @@ -25,7 +25,8 @@ public function query($query) try { $statement->execute(); } catch (PDOException $exception) { - throw new DatabaseException($exception->getMessage() . ' [' . $query . ']', $exception->getCode(), $exception); + throw new DatabaseException('[' . $exception->getCode() . '] ' . $exception->getMessage() . ' [' . $query . ']', + (int)$exception->getCode(), $exception); } return new ResultSet(new ResultSetAdapter($statement));