Handle failure to load post

main2
Bob Mottram 2019-09-17 12:06:59 +01:00
parent ad89134511
commit 2210837a33
1 changed files with 8 additions and 2 deletions

View File

@ -2137,8 +2137,14 @@ def htmlIndividualPost(translate: {}, \
postFilename=locatePost(baseDir,nickname,domain,postJsonObject['object']['inReplyTo']) postFilename=locatePost(baseDir,nickname,domain,postJsonObject['object']['inReplyTo'])
if not postFilename: if not postFilename:
break break
with open(postFilename, 'r') as fp: loadedPost=False
postJsonObject=commentjson.load(fp) try:
with open(postFilename, 'r') as fp:
postJsonObject=commentjson.load(fp)
loadedPost=True
except Exception as e:
print(e)
if loadedPost:
postStr= \ postStr= \
individualPostAsHtml(iconsDir,translate,None, \ individualPostAsHtml(iconsDir,translate,None, \
baseDir,session,wfRequest,personCache, \ baseDir,session,wfRequest,personCache, \