diff options
author | Maria van Keulen <maria@mongodb.com> | 2017-05-05 14:35:29 -0400 |
---|---|---|
committer | Maria van Keulen <maria@mongodb.com> | 2017-06-15 10:33:46 -0400 |
commit | dad8a41d24e86a5b1c4dd9cc73aeede87f05ad74 (patch) | |
tree | 995d0517c1a07627608d13618a2285270cf83283 | |
parent | 4a92de28ed34f85e190744bda3930f3cdbc85e75 (diff) | |
download | mongo-dad8a41d24e86a5b1c4dd9cc73aeede87f05ad74.tar.gz |
SERVER-22322 Add namespaces to listIndexes NamespaceNotFound messages
(cherry picked from commit 9c23775905ef7a9612304c677114cb5f921bd54e)
-rw-r--r-- | src/mongo/db/commands/list_indexes.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mongo/db/commands/list_indexes.cpp b/src/mongo/db/commands/list_indexes.cpp index 53e563ab7bd..1a581074d55 100644 --- a/src/mongo/db/commands/list_indexes.cpp +++ b/src/mongo/db/commands/list_indexes.cpp @@ -134,14 +134,16 @@ public: AutoGetCollectionForRead autoColl(txn, ns); if (!autoColl.getDb()) { - return appendCommandStatus(result, - Status(ErrorCodes::NamespaceNotFound, "no database")); + return appendCommandStatus( + result, + Status(ErrorCodes::NamespaceNotFound, "Database " + ns.db() + " doesn't exist")); } const Collection* collection = autoColl.getCollection(); if (!collection) { - return appendCommandStatus(result, - Status(ErrorCodes::NamespaceNotFound, "no collection")); + return appendCommandStatus( + result, + Status(ErrorCodes::NamespaceNotFound, "Collection " + ns.ns() + " doesn't exist")); } const CollectionCatalogEntry* cce = collection->getCatalogEntry(); |