close connection when safe mode insert results in 'not master'

This commit is contained in:
Kyle Banker 2010-10-29 23:18:49 -04:00
parent 424f08af5e
commit 2939932526
1 changed files with 2 additions and 2 deletions

View File

@ -424,7 +424,7 @@ module Mongo
checkin(sock)
end
if num_received == 1 && (error = docs[0]['err'] || docs[0]['errmsg'])
close
close if error == "not master"
raise Mongo::OperationFailure, error
end
[docs, num_received, cursor_id]