mirror of https://gitee.com/bigwinds/arangodb
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:
parent
f4baf0c436
commit
a6bf8028c7
|
@ -2100,13 +2100,17 @@ Result ClusterInfo::dropCollectionCoordinator( // drop collection
|
||||||
|
|
||||||
if (!clones.empty()) {
|
if (!clones.empty()) {
|
||||||
std::string errorMsg(
|
std::string errorMsg(
|
||||||
"Collection must not be dropped while it is a sharding prototype for "
|
"Collection ");
|
||||||
"collection(s)");
|
errorMsg += coll->name();
|
||||||
|
errorMsg += " must not be dropped while ";
|
||||||
for (auto const& i : clones) {
|
errorMsg += arangodb::basics::StringUtils::join(clones, ", ");
|
||||||
errorMsg += std::string(" ") + i;
|
if(clones.size() == 1) {
|
||||||
}
|
errorMsg += " has ";
|
||||||
|
} else {
|
||||||
|
errorMsg += " have ";
|
||||||
|
};
|
||||||
|
errorMsg += "distributeShardsLike set to ";
|
||||||
|
errorMsg += coll->name();
|
||||||
errorMsg += ".";
|
errorMsg += ".";
|
||||||
|
|
||||||
events::DropCollection(dbName, collectionID,
|
events::DropCollection(dbName, collectionID,
|
||||||
|
|
Loading…
Reference in New Issue