From 7facdc8c94304b57936f198b2ce2d6ee0e7dd1d1 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Fri, 9 Sep 2016 17:05:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BPDOException=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/exception/PDOException.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/think/exception/PDOException.php b/library/think/exception/PDOException.php index abe94d70..677092b9 100644 --- a/library/think/exception/PDOException.php +++ b/library/think/exception/PDOException.php @@ -32,7 +32,7 @@ class PDOException extends DbException $this->setData('PDO Error Info', [ 'SQLSTATE' => $error[0], - 'Driver Error Code' => $error[1], + 'Driver Error Code' => isset($error[1]) ? $error[1] : 0, 'Driver Error Message' => isset($error[2]) ? $error[2] : '', ]);