From: Nicolas Boisselier Date: Tue, 26 Jul 2016 23:46:33 +0000 (+0100) Subject: Bed X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=a7b313fa31e33b0d54b71ef1a17dc998665fab07;p=nb.git Bed --- 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); }