0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 00:56:44 +01:00

can't throw an exception...

This commit is contained in:
Eliot Horowitz 2009-10-20 16:20:22 -04:00
parent 8615f7d1cd
commit 4c856f6e8f

View File

@ -255,19 +255,14 @@ DBCollection.prototype.ensureIndex = function( keys , options ){
var name = this._indexSpec( keys, options ).name;
this._indexCache = this._indexCache || {};
if ( this._indexCache[ name ] ){
return false;
return;
}
this.createIndex( keys , options );
var e = this._db.getLastError();
if ( e != null )
throw e;
if ( this.getDB().getLastError() == "" ) {
this._indexCache[name] = true;
}
return true;
}
DBCollection.prototype.resetIndexCache = function(){