aboutsummaryrefslogtreecommitdiff
path: root/lib/Minz/PDOConnectionException.php
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2019-12-25 23:21:12 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2019-12-25 23:21:12 +0100
commitf3d75b3ae5ba6f375a04b46e4f72a210cafe9d54 (patch)
tree4d45903a949d9bff89a2720614b5fe7300a7d2bc /lib/Minz/PDOConnectionException.php
parentef062803ee5c0ebd4a5e1d08913f1377d2e7db10 (diff)
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.
Diffstat (limited to 'lib/Minz/PDOConnectionException.php')
-rw-r--r--lib/Minz/PDOConnectionException.php5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Minz/PDOConnectionException.php b/lib/Minz/PDOConnectionException.php
index 064748708..11e4d1029 100644
--- a/lib/Minz/PDOConnectionException.php
+++ b/lib/Minz/PDOConnectionException.php
@@ -1,8 +1,7 @@
<?php
class Minz_PDOConnectionException extends Minz_Exception {
- public function __construct ($string_connection, $user, $code = self::ERROR) {
- $message = 'Access to database is denied for `' . $user . '`'
- . ' (`' . $string_connection . '`)';
+ public function __construct ($error, $user, $code = self::ERROR) {
+ $message = 'Access to database is denied for `' . $user . '`: ' . $error;
parent::__construct ($message, $code);
}