PYTHON-766 Fix KeyError when parsing certain mongos error responses.

This commit is contained in:
A. Jesse Jiryu Davis 2014-10-07 17:40:52 -04:00
parent 90098d3844
commit 2e74187e19

View File

@ -143,8 +143,8 @@ def _check_command_response(response, reset, msg=None, allowable_errors=None):
# for some errors.
if "raw" in response:
for shard in response["raw"].itervalues():
if not shard.get("ok"):
# Just grab the first error...
# Grab the first non-empty raw error from a shard.
if shard.get("errmsg") and not shard.get("ok"):
details = shard
break