summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-08-19 12:10:32 -0400
committerEliot Horowitz <eliot@10gen.com>2009-08-19 12:10:32 -0400
commit19c885c5a8ff574c5802e0c4d78c2a08ec48434c (patch)
tree03b5011c8d08c642b7de3c7e77ed899f1ca12c8d
parente57376179dbf656619549d9a54c1b39ef51748f7 (diff)
downloadmongo-19c885c5a8ff574c5802e0c4d78c2a08ec48434c.tar.gz
better error handling
-rw-r--r--shell/db.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/shell/db.js b/shell/db.js
index bc343bc0c21..7cd7effddc9 100644
--- a/shell/db.js
+++ b/shell/db.js
@@ -406,7 +406,11 @@ DB.prototype.group = function(parmsObj) {
}
DB.prototype.groupcmd = function( parmsObj ){
- return this.runCommand( { "group" : this._groupFixParms( parmsObj ) } ).retval;
+ var ret = this.runCommand( { "group" : this._groupFixParms( parmsObj ) } );
+ if ( ! ret.ok ){
+ throw "group command failed: " + tojson( ret );
+ }
+ return ret.retval;
}
DB.prototype._groupFixParms = function( parmsObj ){