summaryrefslogtreecommitdiff
path: root/src/mongo/s/client
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2017-10-16 18:59:08 -0400
committerMathias Stearn <mathias@10gen.com>2017-11-02 14:25:21 -0400
commita0ebc55db521792632fb3ece87edafec327cc2a9 (patch)
treeb2098c89f241082a9c1a55ed69794eef210aa312 /src/mongo/s/client
parent9f8696b5ba4c9310749c5c3f1ee082c5f663b5b0 (diff)
downloadmongo-a0ebc55db521792632fb3ece87edafec327cc2a9.tar.gz
SERVER-31622 Fix bad throws
Diffstat (limited to 'src/mongo/s/client')
-rw-r--r--src/mongo/s/client/parallel.cpp4
-rw-r--r--src/mongo/s/client/sharding_connection_hook.cpp3
2 files changed, 3 insertions, 4 deletions
diff --git a/src/mongo/s/client/parallel.cpp b/src/mongo/s/client/parallel.cpp
index 5ba651ec1b6..a697d830bf8 100644
--- a/src/mongo/s/client/parallel.cpp
+++ b/src/mongo/s/client/parallel.cpp
@@ -68,7 +68,7 @@ void throwCursorError(DBClientCursor* cursor) {
if (cursor->hasResultFlag(ResultFlag_ErrSet)) {
BSONObj o = cursor->next();
- throw AssertionException(o["code"].numberInt(), o["$err"].str());
+ uasserted(o["code"].numberInt(), o["$err"].str());
}
}
@@ -1160,7 +1160,7 @@ void ParallelSortClusteredCursor::_oldInit() {
throw StaleConfigException(
_ns, errMsg.str(), ChunkVersion(0, 0, OID()), ChunkVersion(0, 0, OID()));
} else if (throwException) {
- throw DBException(14827, errMsg.str());
+ uasserted(14827, errMsg.str());
} else {
warning() << redact(errMsg.str());
}
diff --git a/src/mongo/s/client/sharding_connection_hook.cpp b/src/mongo/s/client/sharding_connection_hook.cpp
index f2325d4c88a..94e19f2ee4e 100644
--- a/src/mongo/s/client/sharding_connection_hook.cpp
+++ b/src/mongo/s/client/sharding_connection_hook.cpp
@@ -54,8 +54,7 @@ ShardingConnectionHook::ShardingConnectionHook(bool shardedConnections,
void ShardingConnectionHook::onCreate(DBClientBase* conn) {
if (conn->type() == ConnectionString::INVALID) {
- throw AssertionException(ErrorCodes::BadValue,
- str::stream() << "Unrecognized connection string.");
+ uasserted(ErrorCodes::BadValue, str::stream() << "Unrecognized connection string.");
}
// Authenticate as the first thing we do