warn if index fails to create
This commit is contained in:
parent
c0e8a525bd
commit
824573f297
|
@ -338,7 +338,11 @@ module Mongo
|
|||
:ns => "#{@db.name}.#{@name}",
|
||||
:key => field_h,
|
||||
:unique => unique }
|
||||
insert_documents([sel], Mongo::DB::SYSTEM_INDEX_COLLECTION, false)
|
||||
begin
|
||||
insert_documents([sel], Mongo::DB::SYSTEM_INDEX_COLLECTION, false, true)
|
||||
rescue Mongo::OperationFailure
|
||||
raise Mongo::OperationFailure, "Failed to create index #{sel.inspect}."
|
||||
end
|
||||
name
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue