diff options
author | Katherine Wu <katherine.wu@mongodb.com> | 2020-05-14 13:47:20 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-06-02 20:08:49 +0000 |
commit | becc8e5ecca4260e844725fa71f4ed1164647e4a (patch) | |
tree | 6945818b345b2e5bf943b89a2ec11cb0f40b387f /src/mongo/db/commands/explain_cmd.cpp | |
parent | 1468dbb72e5384c58c8dfc19003beed84befecfd (diff) | |
download | mongo-becc8e5ecca4260e844725fa71f4ed1164647e4a.tar.gz |
SERVER-46625 Improve diagnostics when mongocryptd requests are sent to non-mongocryptd daemon
Diffstat (limited to 'src/mongo/db/commands/explain_cmd.cpp')
-rw-r--r-- | src/mongo/db/commands/explain_cmd.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mongo/db/commands/explain_cmd.cpp b/src/mongo/db/commands/explain_cmd.cpp index 2d3460d6a63..5cc8bc330c8 100644 --- a/src/mongo/db/commands/explain_cmd.cpp +++ b/src/mongo/db/commands/explain_cmd.cpp @@ -145,6 +145,9 @@ std::unique_ptr<CommandInvocation> CmdExplain::parse(OperationContext* opCtx, CommandHelpers::uassertNoDocumentSequences(getName(), request); std::string dbname = request.getDatabase().toString(); const BSONObj& cmdObj = request.body; + uassert(ErrorCodes::FailedToParse, + "Unrecognized field 'jsonSchema'. This command may be meant for a mongocryptd process.", + !cmdObj.hasField("jsonSchema"_sd)); ExplainOptions::Verbosity verbosity = uassertStatusOK(ExplainOptions::parseCmdBSON(cmdObj)); uassert(ErrorCodes::BadValue, "explain command requires a nested object", |