I have put this code to avoid uncaught exceptions crashing app when no mongo connexion, in order application to be still running even when mongo is stopped.
avoid generating uncaught exceptions in app
fix for test compliance
I was just about to work on a similar pull request. Thanks for writing this!
The issue is both that connect-mongo generates unhandled exceptions and that anything which calls _get_collection will never call its callback if an error occurs, which can hang calling code waiting for a response.
One suggestion I'd make for the pull request (or for a separate related pull request) is to either include err.message in the message of the returned Error objects or add a property on them to get to the original error so that users can figure out why connect-mongo was unable to get the collection or ensure the TTL index.
Hi, thanks for feedback, I will check what I can do later ( after holidays now ;) ) but do not hesitate fork it.
Improve error management
Fix #138, #89