From a7651fa1d59b77d7dbf81744e0324df461c91b89 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 21 Jun 2022 13:21:33 +0200 Subject: [PATCH] Changes: - let's at least log the error message, yes it does flood your logfile --- tests/Util/Database/StaticDatabase.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/Util/Database/StaticDatabase.php b/tests/Util/Database/StaticDatabase.php index 0782a9745f..5be4776ee2 100644 --- a/tests/Util/Database/StaticDatabase.php +++ b/tests/Util/Database/StaticDatabase.php @@ -21,6 +21,7 @@ namespace Friendica\Test\Util\Database; +use Friendica\Core\Logger; use Friendica\Database\Database; use Friendica\Database\DatabaseException; use PDO; @@ -179,7 +180,8 @@ class StaticDatabase extends Database self::$staticConnection = @new ExtendedPDO($connect, $user, $pass); self::$staticConnection->setAttribute(PDO::ATTR_AUTOCOMMIT,0); } catch (PDOException $e) { - /// @TODO At least log exception, don't ignore it! + // Log exception + Logger::error('Cannot establish database connection', ['exception' => $e, 'host' => $server, 'dbname' => $db]); } } -- 2.39.5