Closed willianpts closed 9 years ago
Ahh it looks like it kills the MongoDB handle after it encounters the first exception.
@willianpts this fix will change the response to
Catch exception #1 Unable to connect to MongoDB server at mongodb://localhost
Catch exception #2 Failed to connect to: localhost:27017: Previous connection attempts failed, server blacklisted
The second message is from MongoDB. What's your thought about leaving it as is? Should it be caught and converted to similar format as Exception 1?
The first exception is an instance of \Exception and the subsequent exceptions are \MongoConnectionException.
I think It would be appropriate if all the exceptions were \MongoConnectionException, since this is documented http://php.net/manual/en/class.mongoconnectionexception.php
With MongoDB stopped mongodm throws an exception, which is expected. But if we try to save something again, it crashes:
PHP Fatal error: Call to a member function selectCollection() on null in /home/willian/htdocs/test/vendor/purekid/mongodm/src/Purekid/Mongodm/MongoDB.php on line 708