christkv/node-mongodb-native — Issue #425: exceptions from user callbacks should not have side-effects on the driver
Author: vincentcr
Created: 2011-12-04 18:27:39+00:00
State: open

i noticed that when my callback is invoked from the mongodb driver and throws an exception, it will sometimes results in the connection being closed by the reaper. in previous versions of the driver the errors would sometimes get swallowed and rethrown as some other error. this is a big annoyance when executing unit tests, because failed asserts will trigger this behavior . for example, one failed test makes all the other tests fail because the connection has been killed.

i would propose that callback errors be treated as 'expected' behavior, in the sense that they should be simply rethrown unmodified or altogether ignored, without any side-effect to the driver. it should be the user's responsibility to either catch them in the first place, or handle them in an uncaughtException handler.