Merge pull request #11228 from annando/no-db-exception

Don't throw an exception when the database query fails
This commit is contained in:
Hypolite Petovan 2022-02-09 22:16:56 -05:00 committed by GitHub
commit 0e6fe8d8ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -138,6 +138,7 @@ class Database
try { try {
$this->connection = @new PDO($connect, $user, $pass, [PDO::ATTR_PERSISTENT => $persistent]); $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_EMULATE_PREPARES, $this->pdo_emulate_prepares);
$this->connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT);
$this->connected = true; $this->connected = true;
} catch (PDOException $e) { } catch (PDOException $e) {
$this->connected = false; $this->connected = false;