diff options
author | Denis Grebennicov <denis.grebennicov@mongodb.com> | 2021-04-26 17:25:45 +0200 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-04-28 17:20:52 +0000 |
commit | d37ee5b24d620a4a8c451dc8222416ff0aeda817 (patch) | |
tree | 0225077a47eac7f538b4575b36d09ed0d8333b8e | |
parent | a2b125b57449b9dba0f14a2a261389947af44b7b (diff) | |
download | mongo-d37ee5b24d620a4a8c451dc8222416ff0aeda817.tar.gz |
SERVER-56348 Adjust call sites of the optional "std::shared_ptr<const T> mongo::Status::extraInfo"
-rw-r--r-- | src/mongo/db/commands/write_commands.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/mongo/db/commands/write_commands.cpp b/src/mongo/db/commands/write_commands.cpp index 9614a8f8eee..096f12b75e6 100644 --- a/src/mongo/db/commands/write_commands.cpp +++ b/src/mongo/db/commands/write_commands.cpp @@ -301,9 +301,8 @@ boost::optional<BSONObj> generateError(OperationContext* opCtx, BSONObjBuilder errInfo(error.subobjStart("errInfo")); staleInfo->serialize(&errInfo); } - } else if (ErrorCodes::DocumentValidationFailure == status.code() && status.extraInfo()) { - auto docValidationError = - status.extraInfo<doc_validation_error::DocumentValidationFailureInfo>(); + } else if (auto docValidationError = + status.extraInfo<doc_validation_error::DocumentValidationFailureInfo>()) { error.append("code", static_cast<int>(ErrorCodes::DocumentValidationFailure)); error.append("errInfo", docValidationError->getDetails()); } else if (ErrorCodes::isTenantMigrationError(status.code())) { |