diff options
author | Maddie Zechar <mez2113@columbia.edu> | 2021-06-21 15:03:37 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-06-24 22:50:33 +0000 |
commit | 30be200dfcf31bf49073fafe322a2d4998266253 (patch) | |
tree | c4e43ff2cb730b9bd9c9f5047c87c59228dcf72f /src | |
parent | b8b5d3de4df8e0f82491b5d5ccbc4b635f61aecf (diff) | |
download | mongo-30be200dfcf31bf49073fafe322a2d4998266253.tar.gz |
SERVER-55444: APIStrictError directs user to docs for migration suggestions
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/db/initialize_api_parameters.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/mongo/db/initialize_api_parameters.cpp b/src/mongo/db/initialize_api_parameters.cpp index 812a452ea31..dc55104d1fb 100644 --- a/src/mongo/db/initialize_api_parameters.cpp +++ b/src/mongo/db/initialize_api_parameters.cpp @@ -70,12 +70,16 @@ const APIParametersFromClient initializeAPIParameters(const BSONObj& requestBody if (apiParamsFromClient.getApiStrict().get_value_or(false)) { auto cmdApiVersions = command->apiVersions(); auto apiVersionFromClient = apiParamsFromClient.getApiVersion().value().toString(); - bool strictAssert = (cmdApiVersions.find(apiVersionFromClient) != cmdApiVersions.end()); - uassert(ErrorCodes::APIStrictError, - str::stream() << "Provided apiStrict:true, but the command " << command->getName() - << " is not in API Version " << apiVersionFromClient, - strictAssert); + uassert( + ErrorCodes::APIStrictError, + str::stream() << "Provided apiStrict:true, but the command " << command->getName() + << " is not in API Version " << apiVersionFromClient + << ". Information on supported commands and migrations in API Version " + << apiVersionFromClient + << " can be found at " + "https://dochub.mongodb.org/core/manual-versioned-api", + strictAssert); bool strictDoesntWriteToSystemJS = !(command->getReadWriteType() == BasicCommand::ReadWriteType::kWrite && requestBody.firstElementType() == BSONType::String && |