From 8615f7d1cd2a4443b4ae6d2ce478d638021cfcab Mon Sep 17 00:00:00 2001 From: Eliot Horowitz Date: Tue, 20 Oct 2009 16:15:27 -0400 Subject: [PATCH] fix ensureIndex to return errors --- shell/collection.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/shell/collection.js b/shell/collection.js index d7c4c253ed9..83cc98f9716 100644 --- a/shell/collection.js +++ b/shell/collection.js @@ -259,9 +259,14 @@ DBCollection.prototype.ensureIndex = function( keys , options ){ } this.createIndex( keys , options ); + var e = this._db.getLastError(); + if ( e != null ) + throw e; + if ( this.getDB().getLastError() == "" ) { this._indexCache[name] = true; } + return true; }