We should include more information from server command failures in our OperationFailure exception. This would help debug exceptions that are not caught, for example, when an operation inside a multi-document transaction fails with WriteConflict the stack trace is:
...
File "/home/shane/git/mongo-python-driver/pymongo/helpers.py", line 155, in _check_command_response
raise OperationFailure(msg % errmsg, code, response)
pymongo.errors.OperationFailure: WriteConflict
It would be better if we included more information, like the entire error document:
... raise OperationFailure(msg % errmsg, code, response) pymongo.errors.OperationFailure: WriteConflict , full error: {"ok": 0, "errmsg": "WriteConflict", "code": 112, ....}