diff options
Diffstat (limited to 'src/mongo/db/s/check_sharding_index_command.cpp')
| -rw-r--r-- | src/mongo/db/s/check_sharding_index_command.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mongo/db/s/check_sharding_index_command.cpp b/src/mongo/db/s/check_sharding_index_command.cpp index dd5331e33f1..16dbbf8a2fe 100644 --- a/src/mongo/db/s/check_sharding_index_command.cpp +++ b/src/mongo/db/s/check_sharding_index_command.cpp @@ -94,15 +94,15 @@ public: return false; } - std::string tmpErrMsg = "couldn't find valid index for shard key"; auto shardKeyIdx = findShardKeyPrefixedIndex(opCtx, *collection, collection->getIndexCatalog(), keyPattern, - /*requireSingleKey=*/true, - &tmpErrMsg); - - uassert(ErrorCodes::InvalidOptions, str::stream() << tmpErrMsg, shardKeyIdx); + /*requireSingleKey=*/true); + if (!shardKeyIdx) { + errmsg = "couldn't find valid index for shard key"; + return false; + } return true; } |
