From 2e82980a4a770014fd99e6c13e67807c542da091 Mon Sep 17 00:00:00 2001 From: aihailin Date: Wed, 16 Dec 2020 13:14:42 +0800 Subject: [PATCH] =?UTF-8?q?fix.=20PDOException=E7=9A=84code=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E4=B8=BA=E5=AD=97=E7=AC=A6=E4=B8=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/db/src/Connection/Connection.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/db/src/Connection/Connection.php b/src/db/src/Connection/Connection.php index 9a9dd9911..47c860415 100644 --- a/src/db/src/Connection/Connection.php +++ b/src/db/src/Connection/Connection.php @@ -680,7 +680,7 @@ protected function runQueryCallback(string $query, array $bindings, Closure $cal $this->releaseOrRemove(); // Throw exception - throw new DbException($e->getMessage(), $e->getCode(), $e); + throw new DbException($e->getMessage(), (int)$e->getCode(), $e); } // If an exception occurs when attempting to run a query, we'll format the error @@ -698,7 +698,7 @@ protected function runQueryCallback(string $query, array $bindings, Closure $cal CLog::error('Fail err=%s sql=%s', $e->getMessage(), $rawSql); // Throw exception - throw new DbException($e->getMessage(), $e->getCode(), $e); + throw new DbException($e->getMessage(), (int)$e->getCode(), $e); } $this->pdoType = self::TYPE_DEFAULT;