Error handling in the new mongodb C driver

In the old legacy C driver, I had all my transactions wrapped in a loop to reconnect and retry during a dropped connection (MONGO_IO_ERROR) or other unrecognized errors. Is this still needed with the new driver or is it handling an internal connection? I couldn't find any documentation on bson_error_t. My guess is that this tends to contain error codes returned by mongodb, such as how duplicate insert was available with the getlasterror command in the legacy C driver? Is there a list of common ones?

+3


source to share





All Articles