]> git.mxchange.org Git - friendica.git/commitdiff
Changes:
authorRoland Häder <roland@mxchange.org>
Tue, 21 Jun 2022 11:21:33 +0000 (13:21 +0200)
committerRoland Häder <roland@mxchange.org>
Tue, 21 Jun 2022 11:47:40 +0000 (13:47 +0200)
- let's at least log the error message, yes it does flood your logfile

tests/Util/Database/StaticDatabase.php

index 0782a9745fa67025e61c816be42b871622972e9c..5be4776ee2b39469801bd1ac8067e8e483dee0b3 100644 (file)
@@ -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]);
                }
        }