diff options
author | Mathias Stearn <mathias@10gen.com> | 2018-01-09 16:27:55 -0500 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2018-01-17 17:10:47 -0500 |
commit | b165c1e9275016dc15d071d147cec0e5b1bc1f31 (patch) | |
tree | 2520a91e892b8f61ea922e5fafe13eff3fcbe8be /src/mongo/client/dbclient.cpp | |
parent | 84c3f83421b262028081296e4c387d29691ea376 (diff) | |
download | mongo-b165c1e9275016dc15d071d147cec0e5b1bc1f31.tar.gz |
SERVER-32587 Convert StaleConfigException to use ErrorExtraInfo
Diffstat (limited to 'src/mongo/client/dbclient.cpp')
-rw-r--r-- | src/mongo/client/dbclient.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mongo/client/dbclient.cpp b/src/mongo/client/dbclient.cpp index 8028cc1b3bc..29bdb37fcec 100644 --- a/src/mongo/client/dbclient.cpp +++ b/src/mongo/client/dbclient.cpp @@ -179,8 +179,9 @@ rpc::UniqueReply DBClientBase::parseCommandReplyMessage(const std::string& host, uassertStatusOK(_metadataReader(opCtx, commandReply->getMetadata(), host)); } - if (ErrorCodes::StaleConfig == getStatusFromCommandResult(commandReply->getCommandReply())) { - throw StaleConfigException("stale config in runCommand", commandReply->getCommandReply()); + auto status = getStatusFromCommandResult(commandReply->getCommandReply()); + if (status == ErrorCodes::StaleConfig) { + uassertStatusOK(status.withContext("stale config in runCommand")); } return rpc::UniqueReply(replyMsg, std::move(commandReply)); @@ -683,7 +684,7 @@ void DBClientBase::findN(vector<BSONObj>& out, if (c->hasResultFlag(ResultFlag_ShardConfigStale)) { BSONObj error; c->peekError(&error); - throw StaleConfigException("findN stale config", error); + uasserted(StaleConfigInfo(error), "findN stale config"); } for (int i = 0; i < nToReturn; i++) { |