summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mongo/db/catalog/index_create_impl.cpp12
-rw-r--r--src/mongo/db/index/hash_access_method.cpp2
2 files changed, 11 insertions, 3 deletions
diff --git a/src/mongo/db/catalog/index_create_impl.cpp b/src/mongo/db/catalog/index_create_impl.cpp
index 1f21757c7fc..f6fd4d9a994 100644
--- a/src/mongo/db/catalog/index_create_impl.cpp
+++ b/src/mongo/db/catalog/index_create_impl.cpp
@@ -336,14 +336,22 @@ StatusWith<std::vector<BSONObj>> MultiIndexBlockImpl::init(const std::vector<BSO
} catch (const WriteConflictException&) {
throw;
} catch (...) {
- return {exceptionToStatus().code(),
+ auto status = exceptionToStatus();
+ std::string separator =
+ (status.reason().size() > 0 && status.reason()[status.reason().size() - 1] == '.')
+ ? ""
+ : ".";
+ return {status.code(),
str::stream() << "Caught exception during index builder initialization "
<< _collection->ns().toString()
<< " ("
<< _collection->uuid()
<< "): "
+ << status.reason()
+ << separator
+ << " First index spec (of "
<< indexSpecs.size()
- << " provided. First index spec: "
+ << "): "
<< (indexSpecs.empty() ? BSONObj() : indexSpecs[0])};
}
}
diff --git a/src/mongo/db/index/hash_access_method.cpp b/src/mongo/db/index/hash_access_method.cpp
index d7b79f1c0c9..a3a96a997bd 100644
--- a/src/mongo/db/index/hash_access_method.cpp
+++ b/src/mongo/db/index/hash_access_method.cpp
@@ -43,7 +43,7 @@ HashAccessMethod::HashAccessMethod(IndexCatalogEntry* btreeState, SortedDataInte
// We can change these if the single-field limitation is lifted later.
uassert(16763,
- "Currently only single field hashed index supported.",
+ "Hashed indices currently only support a single field.",
1 == descriptor->getNumFields());
uassert(16764,