Add exception for file read

main
Bob Mottram 2024-07-18 20:32:03 +01:00
parent 8c30b537ab
commit e95f6b8261
1 changed files with 45 additions and 41 deletions

View File

@ -138,6 +138,7 @@ def html_hash_tag_swarm(base_dir: str, actor: str, translate: {}) -> str:
tags_filename)
continue
try:
with open(tags_filename, 'r', encoding='utf-8') as fp_tags:
while True:
line = fp_tags.readline()
@ -180,6 +181,9 @@ def html_hash_tag_swarm(base_dir: str, actor: str, translate: {}) -> str:
if category_str not in category_swarm:
category_swarm.append(category_str)
break
except OSError as exc:
print('EX: html_hash_tag_swarm unable to read ' +
tags_filename + ' ' + str(exc))
break
if not tag_swarm: