]> git.mxchange.org Git - friendica.git/commitdiff
Don't throw an exception when the database query fails
authorMichael <heluecht@pirati.ca>
Tue, 8 Feb 2022 21:28:42 +0000 (21:28 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 8 Feb 2022 21:28:42 +0000 (21:28 +0000)
src/Database/Database.php

index cc7f754ee6fda19e9f15f39b07386b7729a8f16d..f478d7993a1844dfac0f49c76da20f1c6bcef8a3 100644 (file)
@@ -138,6 +138,7 @@ class Database
                        try {
                                $this->connection = @new PDO($connect, $user, $pass, [PDO::ATTR_PERSISTENT => $persistent]);
                                $this->connection->setAttribute(PDO::ATTR_EMULATE_PREPARES, $this->pdo_emulate_prepares);
+                               $this->connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT);
                                $this->connected = true;
                        } catch (PDOException $e) {
                                $this->connected = false;