Set $this->db=null on errors in connect
This commit is contained in:
parent
ed3968b5aa
commit
86cecf8cfb
|
|
@ -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 { }
|
||||
|
|
|
|||
Loading…
Reference in New Issue