- let's at least log the error message, yes it does flood your logfile
This commit is contained in:
Roland Häder 2022-06-21 13:21:33 +02:00
parent 1080a840f5
commit a7651fa1d5
No known key found for this signature in database
GPG Key ID: C82EDE5DDFA0BA77

View File

@ -21,6 +21,7 @@
namespace Friendica\Test\Util\Database; namespace Friendica\Test\Util\Database;
use Friendica\Core\Logger;
use Friendica\Database\Database; use Friendica\Database\Database;
use Friendica\Database\DatabaseException; use Friendica\Database\DatabaseException;
use PDO; use PDO;
@ -179,7 +180,8 @@ class StaticDatabase extends Database
self::$staticConnection = @new ExtendedPDO($connect, $user, $pass); self::$staticConnection = @new ExtendedPDO($connect, $user, $pass);
self::$staticConnection->setAttribute(PDO::ATTR_AUTOCOMMIT,0); self::$staticConnection->setAttribute(PDO::ATTR_AUTOCOMMIT,0);
} catch (PDOException $e) { } 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]);
} }
} }