diff --git a/src/Query/SqlQuery.php b/src/Query/SqlQuery.php index e950da5..f407f1e 100644 --- a/src/Query/SqlQuery.php +++ b/src/Query/SqlQuery.php @@ -71,10 +71,10 @@ public function execute(array $bindings = []):ResultSet { $lastInsertId = $pdo->lastInsertId(); } catch(PDOException $exception) { + $code = $exception->getCode(); throw new PreparedStatementException( - $exception->getMessage(), - $exception->getCode(), - $exception + $exception->getMessage() . " (Code $code)", + previous: $exception ); } }