From a40d13296bac5a4c02fac2520990b744e2eb0652 Mon Sep 17 00:00:00 2001 From: James Hadfield Date: Fri, 16 Sep 2022 10:57:04 +1200 Subject: [PATCH] Warn (not error) for duplicated nodes We can handle trees with duplicated / missing node names, and there are datasets which legitimately use this, so these are warnings not errors. Closes #1541 --- src/util/treeJsonProcessing.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/treeJsonProcessing.js b/src/util/treeJsonProcessing.js index 923459948..fd0bce154 100644 --- a/src/util/treeJsonProcessing.js +++ b/src/util/treeJsonProcessing.js @@ -24,12 +24,12 @@ const processNodes = (nodes) => { very hard-to-interpret Auspice errors which we can improve by dectecting problems early */ if (!d.name) { d.name = pseudoRandomName(); - console.error(`Tree node without a name detected. This dataset is not valid. Using the name '${d.name}' and continuing...`); + console.warn(`Tree node without a name detected. Using the name '${d.name}' and continuing...`); } if (nodeNamesSeen.has(d.name)) { const prev = d.name; d.name = `${d.name}_${pseudoRandomName()}`; - console.error(`Tree node detected with a duplicate name. This dataset is not valid. Changing '${prev}' to '${d.name}' and continuing...`); + console.warn(`Tree node detected with a duplicate name. Changing '${prev}' to '${d.name}' and continuing...`); } nodeNamesSeen.add(d.name); });