Exception handling in threaded post

main2
Bob Mottram 2019-10-14 22:05:14 +01:00
parent cb0f95c62b
commit 85415f579f
1 changed files with 9 additions and 4 deletions

View File

@ -1007,10 +1007,15 @@ def threadSendPost(session,postJsonStr: str,federationList: [],\
tries=0
backoffTime=60
for attempt in range(20):
postResult=None
try:
postResult = \
postJsonString(session,postJsonStr,federationList, \
inboxUrl,signatureHeaderJson, \
"inbox:write",debug)
except Exception as e:
print('ERROR: postJsonString failed')
print(e)
if postResult:
logStr='Success on try '+str(tries)+': '+postJsonStr
else: