Set $this->db=null on errors in connect

This commit is contained in:
rootcoma 2013-11-27 03:38:43 -08:00
parent ed3968b5aa
commit 86cecf8cfb
1 changed files with 4 additions and 3 deletions

View File

@ -16,10 +16,11 @@
try {
$this->db = new PDO($this->dbType . $this->dbLocation);
if(!$this->db) {
throw new StorageConnectionException($err);
$this->db = null;
throw new StorageConnectionException();
}
} catch (Exception $e) {
$this->db = null;
}
}
}
@ -298,4 +299,4 @@
class StorageSchemaException extends StorageException { }
class StorageConnectionException extends StorageException { }
class StorageConnectionException extends StorageException { }