Improve exception.

This commit is contained in:
Paulo Gustavo Veiga 2022-11-03 18:50:18 -07:00
parent 159557b73c
commit 50267e9364

View File

@ -53,7 +53,15 @@ const TopicFeatureFactory = {
const { icon: Icon } = TopicFeatureFactory._featuresMetadataById.filter( const { icon: Icon } = TopicFeatureFactory._featuresMetadataById.filter(
(elem) => elem.id === model.getType(), (elem) => elem.id === model.getType(),
)[0]; )[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;
}, },
}; };