From 50267e9364d793e1688e1d7e0efa298e465f6398 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Thu, 3 Nov 2022 18:50:18 -0700 Subject: [PATCH] Improve exception. --- packages/mindplot/src/components/TopicFeature.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/mindplot/src/components/TopicFeature.js b/packages/mindplot/src/components/TopicFeature.js index a311414b..5e79625f 100644 --- a/packages/mindplot/src/components/TopicFeature.js +++ b/packages/mindplot/src/components/TopicFeature.js @@ -53,7 +53,15 @@ const TopicFeatureFactory = { const { icon: Icon } = TopicFeatureFactory._featuresMetadataById.filter( (elem) => elem.id === model.getType(), )[0]; - return new Icon(topic, model, readOnly); + + // Temporal catch to idenfify bug. Please, remove. + let result; + try { + result = new Icon(topic, model, readOnly); + } catch (e) { + throw new Error(`${e} - ${JSON.stringify(model)}`); + } + return result; }, };