diff options
author | Eliot Horowitz <eliot@10gen.com> | 2009-08-19 12:10:32 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2009-08-19 12:10:32 -0400 |
commit | 19c885c5a8ff574c5802e0c4d78c2a08ec48434c (patch) | |
tree | 03b5011c8d08c642b7de3c7e77ed899f1ca12c8d | |
parent | e57376179dbf656619549d9a54c1b39ef51748f7 (diff) | |
download | mongo-19c885c5a8ff574c5802e0c4d78c2a08ec48434c.tar.gz |
better error handling
-rw-r--r-- | shell/db.js | 6 |
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 ){ |