From a7b313fa31e33b0d54b71ef1a17dc998665fab07 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Wed, 27 Jul 2016 00:46:33 +0100 Subject: [PATCH] Bed --- lib/php/db.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/php/db.php b/lib/php/db.php index bb268c4a..254c819c 100644 --- a/lib/php/db.php +++ b/lib/php/db.php @@ -162,8 +162,12 @@ class Db extends nb { #if (isset($this->pdo_error)) $this->conn->setAttribute($this->pdo_error[0], $this->pdo_error[1]); } catch (PDOException $e) { - throw new Exception('Connection failed: ' . $e->getMessage(), (int)$e->getCode( )); - self::bye('Connection failed: ' . $e->getMessage()); + $msg = 'Connection failed: ' . $e->getMessage(); + foreach(['name','host','file'] as $p) { + if (!empty($this->$p)) $msg .= " | $p:".$this->$p; + } + throw new Exception($msg, (int)$e->getCode( )); + self::bye($msg); } -- 2.47.3