Files
FreshRSS/lib/Minz/PDOConnectionException.php
Marien Fressinaud f3d75b3ae5 tec: Improve logs on DB connection failure (#2734)
For a moment, PHP wasn't able to connect to my database. I tried to
understand what happened, unfortunately, the logs were not very helpful
(it basically showed me information that I had in my configuration
file).

I changed the dsn string by the message from the raised exception, I
think it will be more useful.

Other call of Minz_PDOConnectionException are passing error messages
instead of string connection, so I took the opportunity to rename the
constructor argument.
2019-12-25 23:21:12 +01:00

9 lines
256 B
PHP

<?php
class Minz_PDOConnectionException extends Minz_Exception {
public function __construct ($error, $user, $code = self::ERROR) {
$message = 'Access to database is denied for `' . $user . '`: ' . $error;
parent::__construct ($message, $code);
}
}