diff options
author | Mathias Stearn <mathias@10gen.com> | 2017-10-16 18:59:08 -0400 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2017-11-02 14:25:21 -0400 |
commit | a0ebc55db521792632fb3ece87edafec327cc2a9 (patch) | |
tree | b2098c89f241082a9c1a55ed69794eef210aa312 /src/mongo/shell/shell_options.cpp | |
parent | 9f8696b5ba4c9310749c5c3f1ee082c5f663b5b0 (diff) | |
download | mongo-a0ebc55db521792632fb3ece87edafec327cc2a9.tar.gz |
SERVER-31622 Fix bad throws
Diffstat (limited to 'src/mongo/shell/shell_options.cpp')
-rw-r--r-- | src/mongo/shell/shell_options.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/mongo/shell/shell_options.cpp b/src/mongo/shell/shell_options.cpp index 32dcf89bef0..7898fc6fa1b 100644 --- a/src/mongo/shell/shell_options.cpp +++ b/src/mongo/shell/shell_options.cpp @@ -348,20 +348,18 @@ Status storeMongoShellOptions(const moe::Environment& params, if (params.count("writeMode")) { std::string mode = params["writeMode"].as<string>(); if (mode != "commands" && mode != "legacy" && mode != "compatibility") { - throw AssertionException( - 17396, mongoutils::str::stream() << "Unknown writeMode option: " << mode); + uasserted(17396, mongoutils::str::stream() << "Unknown writeMode option: " << mode); } shellGlobalParams.writeMode = mode; } if (params.count("readMode")) { std::string mode = params["readMode"].as<string>(); if (mode != "commands" && mode != "compatibility" && mode != "legacy") { - throw AssertionException( - 17397, - mongoutils::str::stream() - << "Unknown readMode option: '" - << mode - << "'. Valid modes are: {commands, compatibility, legacy}"); + uasserted(17397, + mongoutils::str::stream() + << "Unknown readMode option: '" + << mode + << "'. Valid modes are: {commands, compatibility, legacy}"); } shellGlobalParams.readMode = mode; } @@ -369,10 +367,10 @@ Status storeMongoShellOptions(const moe::Environment& params, std::string protos = params["rpcProtocols"].as<string>(); auto parsedRPCProtos = rpc::parseProtocolSet(protos); if (!parsedRPCProtos.isOK()) { - throw AssertionException(28653, - str::stream() << "Unknown RPC Protocols: '" << protos - << "'. Valid values are {none, opQueryOnly, " - << "opCommandOnly, all}"); + uasserted(28653, + str::stream() << "Unknown RPC Protocols: '" << protos + << "'. Valid values are {none, opQueryOnly, " + << "opCommandOnly, all}"); } shellGlobalParams.rpcProtocols = parsedRPCProtos.getValue(); } |