close connection on exception on safe insert
This commit is contained in:
parent
0b0834eb91
commit
424f08af5e
|
@ -424,6 +424,7 @@ module Mongo
|
|||
checkin(sock)
|
||||
end
|
||||
if num_received == 1 && (error = docs[0]['err'] || docs[0]['errmsg'])
|
||||
close
|
||||
raise Mongo::OperationFailure, error
|
||||
end
|
||||
[docs, num_received, cursor_id]
|
||||
|
|
Loading…
Reference in New Issue