diff options
author | Sophia Tan <sophia_tll@hotmail.com> | 2023-04-14 16:58:46 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-04-14 18:35:09 +0000 |
commit | 0fc9bd3a09e996c21883151ab3c8d0ae910d1af2 (patch) | |
tree | 14429bd8255a8b5d7f809aab1b41393b0f31d007 /src/mongo/s/commands | |
parent | 5ddce0f5ecb5a199fc3e9ba3b94c6b630a5b7b6d (diff) | |
download | mongo-0fc9bd3a09e996c21883151ab3c8d0ae910d1af2.tar.gz |
SERVER-75408 Always include tenant in db name attributes in internal server error messages
Diffstat (limited to 'src/mongo/s/commands')
-rw-r--r-- | src/mongo/s/commands/cluster_drop_database_cmd.cpp | 4 | ||||
-rw-r--r-- | src/mongo/s/commands/cluster_filemd5_cmd.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/s/commands/cluster_drop_database_cmd.cpp b/src/mongo/s/commands/cluster_drop_database_cmd.cpp index cbba68c13c3..b0256392d67 100644 --- a/src/mongo/s/commands/cluster_drop_database_cmd.cpp +++ b/src/mongo/s/commands/cluster_drop_database_cmd.cpp @@ -64,8 +64,8 @@ public: } void doCheckAuthorization(OperationContext* opCtx) const final { uassert(ErrorCodes::Unauthorized, - str::stream() << "Not authorized to drop database '" << request().getDbName() - << "'", + str::stream() << "Not authorized to drop database '" + << request().getDbName().toStringForErrorMsg() << "'", AuthorizationSession::get(opCtx->getClient()) ->isAuthorizedForActionsOnNamespace(ns(), ActionType::dropDatabase)); } diff --git a/src/mongo/s/commands/cluster_filemd5_cmd.cpp b/src/mongo/s/commands/cluster_filemd5_cmd.cpp index 12ab9f07730..506cef91752 100644 --- a/src/mongo/s/commands/cluster_filemd5_cmd.cpp +++ b/src/mongo/s/commands/cluster_filemd5_cmd.cpp @@ -172,7 +172,7 @@ public: BSON("files_id" << cmdObj.firstElement() << "n" << numGridFSChunksProcessed)); uassert(16246, - str::stream() << "Shard for database " << nss.db() + str::stream() << "Shard for database " << nss.dbName().toStringForErrorMsg() << " is too old to support GridFS sharded by {files_id:1, n:1}", res.hasField("md5state")); |