diff --git a/src/tag-list/index.ts b/src/tag-list/index.ts index c25140d..8a54141 100644 --- a/src/tag-list/index.ts +++ b/src/tag-list/index.ts @@ -281,14 +281,10 @@ class TagList { _getAllTemplates (PLC: Controller): Promise { return new Promise (async (resolve, reject) => { for (const tag of this.tags) { - if (tag.type.structure && !this.templates[tag.type.code]) { - - try { - const template = new Template(); - await template.getTemplate(PLC, tag.type.code); - this.templates[tag.type.code] = template; - } catch (e) { /* ignore template fetching errors */ } - + if (tag.type.structure && !this.templates[tag.type.code]) { + const template = new Template(); + await template.getTemplate(PLC, tag.type.code).catch((e) => { /* ignore template fetching errors */ }); + this.templates[tag.type.code] = template; } } @@ -316,4 +312,4 @@ class TagList { } export default TagList; -export {tagListTag, tagListTemplates, tagListTagType} \ No newline at end of file +export {tagListTag, tagListTemplates, tagListTagType}