From 14f0a1a1ed229ae8b5e779fb103204ff0c536a8b Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 8 Feb 2022 21:28:42 +0000 Subject: [PATCH] Don't throw an exception when the database query fails --- src/Database/Database.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Database/Database.php b/src/Database/Database.php index cc7f754ee6..f478d7993a 100644 --- a/src/Database/Database.php +++ b/src/Database/Database.php @@ -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;