christkv/node-mongodb-native — pull request #379 by scriby (2011-10-20 18:21:19+00:00)
Title: MongoDB driver shouldn't try to catch errors from user code

Hi,

We appreciate the hard work you've done on this driver as it's enabled us to use Nodejs as a platform.

Thanks for resolving the issue I entered about errors thrown from user code killing the mongo connection.

We've been running on the updated version of the driver in development, and noticed that errors thrown in our code often get swallowed by the mongo driver now. We implemented the logger piece so we can see the errors, but it would be preferable if the mongo driver didn't attempt to handle errors thrown in user code.

I've attempted to tweak your code to use try / finally. It's fine if the driver uses try / catch to handle errors from the driver itself, but catching errors that are up the call stack in user code adds confusion.

Thanks for taking a look at this!

Chris