Currently, MongoQueryException only stores the message string. For our internal error handling mechanism it would be much better if it provided access to the response document.
MongoCommandException, for example, has the ability to store CommandResult, and having something like QueryResult, containing the response document would be very good.
I think this will be a good addition for everyone to use, at least to be able to do detailed logging.
Currently, because there is no access to the response document we have to do error testing in the following way (yes, this code smells, but there's no choice right now) :
catch (MongoQueryException exception)
"))
{ ... }}