mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
Merge pull request #22 from utopia-php/feat-connection-failure-error
Add error handling for MongoDB connection failure in Client class
This commit is contained in:
1 file changed
+3
-1
+3
-1
@@ -118,8 +118,10 @@ class Client
|
||||
if ($this->client->isConnected()) {
|
||||
return $this;
|
||||
}
|
||||
if (!$this->client->connect($this->host, $this->port)) {
|
||||
throw new Exception("Failed to connect to MongoDB at {$this->host}:{$this->port}");
|
||||
}
|
||||
|
||||
$this->client->connect($this->host, $this->port);
|
||||
[$payload, $db] = $this->auth->start();
|
||||
|
||||
$res = $this->query($payload, $db);
|
||||
|
||||
Reference in new issue
Block a user