diff --git a/src/Client.php b/src/Client.php index 9299cbddcd..c2e68eb203 100644 --- a/src/Client.php +++ b/src/Client.php @@ -118,10 +118,9 @@ class Client if ($this->client->isConnected()) { return $this; } - - if(!$this->client->connect($this->host, $this->port)){ - throw new \Exception("Failed to connect to MongoDB"); - } + if (!$this->client->connect($this->host, $this->port)) { + throw new Exception("Failed to connect to MongoDB at {$this->host}:{$this->port}"); + } [$payload, $db] = $this->auth->start();