From d3146ab7933f7fb383aec5240ea9bc164eb5901e Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Wed, 21 Sep 2016 23:22:34 +0100 Subject: [PATCH] fix bug --- lib/php/db.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/php/db.php b/lib/php/db.php index 32ecb083..64cb6d53 100644 --- a/lib/php/db.php +++ b/lib/php/db.php @@ -209,10 +209,11 @@ class Db extends nb { #if (isset($this->pdo_error)) $this->conn->setAttribute($this->pdo_error[0], $this->pdo_error[1]); } catch (PDOException $e) { - $msg = 'Connection failed: ' . $e->getMessage(); + $msg = 'Connection failed:'; foreach(['name','host','file'] as $p) { - if (!empty($this->$p)) $msg .= " | $p:".$this->$p; + if (!empty($this->$p)) $msg .= " $p=".$this->$p; } + $msg .= $e->getMessage(); throw new Exception($msg, (int)$e->getCode()); self::bye($msg); -- 2.47.3