openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 4e5162c792dc434c3a8bdc48f2965c5eb1104d61
parent 8207afa90990a5d4c6e5940a1e4799e94b687d59
Author: Jan Dankert <devnull@localhost>
Date:   Tue, 22 May 2018 22:59:32 +0200

Direkte Logausgabe, wenn Datenbankverbindung fehlschlägt. Und die RTE richtig befüllen.

Diffstat:
modules/database/driver/PDODriver.class.php | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/database/driver/PDODriver.class.php b/modules/database/driver/PDODriver.class.php @@ -108,12 +108,13 @@ class PDODriver } catch(\PDOException $e) { - throw new \RuntimeException("Could not connect to database on host $url.",$e); + Logger::warn( "Could not connect to database: ".$e->getMessage() ); + throw new \RuntimeException("Could not connect to database on host $url.",0,$e); } // This should never happen, because PDO should throw an exception if the connection fails. if ( !is_object($this->connection) ) - throw new RuntimeException("Could not connect to database on host $url. ".PDO::errorInfo() ); + throw new RuntimeException("Could not connect to database on host '$url', Reason: ".PDO::errorInfo() ); return true; }