From ed39069cc213f127940f7179f30ecc6b79f6354d Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Fri, 3 Jul 2020 13:24:09 +0300 Subject: [PATCH] New connection should throw exceptions too --- src/Appwrite/Extend/PDO.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Appwrite/Extend/PDO.php b/src/Appwrite/Extend/PDO.php index aa42612e5..fce9165b4 100644 --- a/src/Appwrite/Extend/PDO.php +++ b/src/Appwrite/Extend/PDO.php @@ -61,6 +61,12 @@ class PDO extends PDONative public function reconnect() { - return $this->pdo = new PDONative($this->dsn, $this->username, $this->passwd, $this->options); + $this->pdo = new PDONative($this->dsn, $this->username, $this->passwd, $this->options); + + // Connection settings + $this->pdo->setAttribute(PDONative::ATTR_DEFAULT_FETCH_MODE, PDONative::FETCH_ASSOC); // Return arrays + $this->pdo->setAttribute(PDONative::ATTR_ERRMODE, PDONative::ERRMODE_EXCEPTION); // Handle all errors with exceptions + + return $this->pdo; } } \ No newline at end of file