diff options
author | Sophia Tan <sophia_tll@hotmail.com> | 2023-04-18 07:41:17 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-04-18 08:57:59 +0000 |
commit | 274cb477d2a1b64ac81b85e9f1b3172387ce0184 (patch) | |
tree | e89f778fa52a40413403b6a125b69271cf8469c0 /src/mongo/db/commands/getmore_cmd.cpp | |
parent | 8863b04c282557081cf2634bce0e26f4fa5389b2 (diff) | |
download | mongo-274cb477d2a1b64ac81b85e9f1b3172387ce0184.tar.gz |
SERVER-74486 Always include tenant in collection name attributes in error messages
Diffstat (limited to 'src/mongo/db/commands/getmore_cmd.cpp')
-rw-r--r-- | src/mongo/db/commands/getmore_cmd.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mongo/db/commands/getmore_cmd.cpp b/src/mongo/db/commands/getmore_cmd.cpp index 8b2f980dd98..40e307e999c 100644 --- a/src/mongo/db/commands/getmore_cmd.cpp +++ b/src/mongo/db/commands/getmore_cmd.cpp @@ -164,13 +164,14 @@ void validateAuthorization(const OperationContext* opCtx, const ClientCursor& cu */ void validateNamespace(const NamespaceString& commandNss, const ClientCursor& cursor) { uassert(ErrorCodes::Unauthorized, - str::stream() << "Requested getMore on namespace '" << commandNss.ns() - << "', but cursor belongs to a different namespace " << cursor.nss().ns(), + str::stream() << "Requested getMore on namespace '" << commandNss.toStringForErrorMsg() + << "', but cursor belongs to a different namespace " + << cursor.nss().toStringForErrorMsg(), commandNss == cursor.nss()); if (commandNss.isOplog() && MONGO_unlikely(rsStopGetMoreCmd.shouldFail())) { uasserted(ErrorCodes::CommandFailed, - str::stream() << "getMore on " << commandNss.ns() + str::stream() << "getMore on " << commandNss.toStringForErrorMsg() << " rejected due to active fail point rsStopGetMoreCmd"); } } @@ -325,7 +326,7 @@ public: NamespaceString nss(NamespaceStringUtil::parseNamespaceFromRequest( _cmd.getDbName(), _cmd.getCollection())); uassert(ErrorCodes::InvalidNamespace, - str::stream() << "Invalid namespace for getMore: " << nss.ns(), + str::stream() << "Invalid namespace for getMore: " << nss.toStringForErrorMsg(), nss.isValid()); } |