1
0
Fork 0

Try improving error message (#9303)

When we try dropping a collection `A` for which there are other collections
that have distributeShardsLike set to `A`, mention this in the error message.
This commit is contained in:
Markus Pfeiffer 2019-06-21 13:23:42 +01:00 committed by Michael Hackstein
parent f4baf0c436
commit a6bf8028c7
1 changed files with 11 additions and 7 deletions

View File

@ -2100,13 +2100,17 @@ Result ClusterInfo::dropCollectionCoordinator( // drop collection
if (!clones.empty()) {
std::string errorMsg(
"Collection must not be dropped while it is a sharding prototype for "
"collection(s)");
for (auto const& i : clones) {
errorMsg += std::string(" ") + i;
}
"Collection ");
errorMsg += coll->name();
errorMsg += " must not be dropped while ";
errorMsg += arangodb::basics::StringUtils::join(clones, ", ");
if(clones.size() == 1) {
errorMsg += " has ";
} else {
errorMsg += " have ";
};
errorMsg += "distributeShardsLike set to ";
errorMsg += coll->name();
errorMsg += ".";
events::DropCollection(dbName, collectionID,