From 30be200dfcf31bf49073fafe322a2d4998266253 Mon Sep 17 00:00:00 2001 From: Maddie Zechar Date: Mon, 21 Jun 2021 15:03:37 +0000 Subject: SERVER-55444: APIStrictError directs user to docs for migration suggestions --- src/mongo/db/initialize_api_parameters.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/mongo/db/initialize_api_parameters.cpp') 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 && -- cgit v1.2.1