]> git.nbdom.net Git - nb.git/commitdiff
fix bug
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Wed, 21 Sep 2016 22:22:34 +0000 (23:22 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Wed, 21 Sep 2016 22:22:34 +0000 (23:22 +0100)
lib/php/db.php

index 32ecb0833f0bd7b131da4ae9f3e070682897e119..64cb6d53f0cb833d24bfd0766dce1b8010b1b5f2 100644 (file)
@@ -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);