Skip to content

Commit

Permalink
Merge pull request #173 from IlyaSkriblovsky/bulk-ops
Browse files Browse the repository at this point in the history
Fixed handling of connection errors in bulk_write
  • Loading branch information
psi29a committed Jun 23, 2016
2 parents 202ed5a + 658e0cc commit 49cd126
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion txmongo/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -1171,6 +1171,9 @@ def accumulate_result(reply, idx_offset):
all_responses.append(batch_result)

if self.write_concern.acknowledged and not ordered:
yield defer.DeferredList(all_responses)
try:
yield defer.gatherResults(all_responses, consumeErrors=True)
except defer.FirstError as e:
e.subFailure.raiseException()

defer.returnValue(results)

0 comments on commit 49cd126

Please sign in to comment.