From: Nicolas Boisselier Date: Tue, 12 Jan 2016 22:47:32 +0000 (+0100) Subject: dont catch error when connect to db X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=7dbff22dc1a9572c09b8ee127221b8ba361e4e16;p=nb.git dont catch error when connect to db --- diff --git a/lib/php/db.php b/lib/php/db.php index 70199701..1018b72e 100644 --- a/lib/php/db.php +++ b/lib/php/db.php @@ -62,17 +62,17 @@ class db extends nb { $this->type = strtolower(preg_replace('/^([^:]+):.*$/','\1',$this->pdo)); #preg_match_all('/[:;](user|username|password)=([^;]*)/',$this->pdo,$m); bye($m); - try { +# NB 12.01.16 try { $this->conn = new PDO($this->pdo,$this->username,$this->password,$this->options); if (isset($this->pdo_error)) $this->conn->setAttribute(PDO::ATTR_ERRMODE, $this->pdo_error); - } catch (PDOException $e) { - - err($e->getMessage(), "Db.new()"); - return false; - - } +# NB 12.01.16 } catch (PDOException $e) { +# NB 12.01.16 +# NB 12.01.16 err($e->getMessage(), "Db.new()"); +# NB 12.01.16 return false; +# NB 12.01.16 +# NB 12.01.16 } #if (empty($this->name)) $this->name = preg_replace('/^(?:(?:sqlite:.*(.*?)(\.\w+)?)|(?:.*?dbname=([^;]+).*?))$/','\1',$this->pdo); # NB 22.12.15 if (empty($this->name) and preg_match('/(?:sqlite:|dbname=)([^;\.]+)/',$this->pdo,$m)) {