Skip to content

Commit

Permalink
catch KeyError (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmacata authored Dec 22, 2021
1 parent 2e26e33 commit bf71866
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions actinia_module_plugin/core/modules/actinia_global_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,19 @@ def createProcessChainTemplateListFromFileSystem():
except Exception:
log.error('Error parsing template ' + tpl_string)

tpl_id = pc_template['id']
description = pc_template['description']
categories = ['actinia-module', 'global-template']

pc_response = (Module(
id=tpl_id,
description=description,
categories=categories
))
pc_list.append(pc_response)
try:
tpl_id = pc_template['id']
description = pc_template['description']
categories = ['actinia-module', 'global-template']

pc_response = (Module(
id=tpl_id,
description=description,
categories=categories
))
pc_list.append(pc_response)

except KeyError:
log.warning('Could not read template %s' % pc_template)

return pc_list

0 comments on commit bf71866

Please sign in to comment.