]> git.nbdom.net Git - nb.git/commitdiff
Bed
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 26 Jul 2016 23:46:33 +0000 (00:46 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 26 Jul 2016 23:46:33 +0000 (00:46 +0100)
lib/php/db.php

index bb268c4a2cd21a4f3875f64a3a9f4c0d502e9772..254c819c7ebbc0fb8c21bb996d0bc42ba7a69b5d 100644 (file)
@@ -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);
 
     }