summaryrefslogtreecommitdiff
path: root/src/mongo/s/commands
diff options
context:
space:
mode:
authorSophia Tan <sophia_tll@hotmail.com>2023-04-14 16:58:46 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-04-14 18:35:09 +0000
commit0fc9bd3a09e996c21883151ab3c8d0ae910d1af2 (patch)
tree14429bd8255a8b5d7f809aab1b41393b0f31d007 /src/mongo/s/commands
parent5ddce0f5ecb5a199fc3e9ba3b94c6b630a5b7b6d (diff)
downloadmongo-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.cpp4
-rw-r--r--src/mongo/s/commands/cluster_filemd5_cmd.cpp2
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"));