summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Alabi <alabidan@gmail.com>2015-03-12 18:49:41 -0400
committerDaniel Alabi <alabidan@gmail.com>2015-03-13 08:38:34 -0400
commit8b1c4e3824fb63a70f9dbb9522176bbf4a4913df (patch)
tree5cbe539c1d2c5765dcc1308f42c7b8f23a174547
parent0144f59236f507bf4a75a1e2b698100bcd75e4da (diff)
downloadmongo-8b1c4e3824fb63a70f9dbb9522176bbf4a4913df.tar.gz
SERVER-15854 Use ShardNotFound error code for deleted shard
-rw-r--r--src/mongo/s/commands/cluster_remove_shard_cmd.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mongo/s/commands/cluster_remove_shard_cmd.cpp b/src/mongo/s/commands/cluster_remove_shard_cmd.cpp
index 4e38a7bc9ac..d50dec231ac 100644
--- a/src/mongo/s/commands/cluster_remove_shard_cmd.cpp
+++ b/src/mongo/s/commands/cluster_remove_shard_cmd.cpp
@@ -102,10 +102,12 @@ namespace {
Shard s = Shard::findIfExists(target);
if (s == Shard::EMPTY) {
- errmsg = str::stream() << "shard '" << target << "'"
- << " does not exist";
- log() << errmsg;
- return false;
+ string msg(str::stream() <<
+ "Could not drop shard '" << target <<
+ "' because it does not exist");
+ log() << msg;
+ return appendCommandStatus(result,
+ Status(ErrorCodes::ShardNotFound, msg));
}
ScopedDbConnection conn(configServer.getPrimary().getConnString(), 30);