From 85415f579f390d4ff3306eb4c6ad990a41cc93e9 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 14 Oct 2019 22:05:14 +0100 Subject: [PATCH] Exception handling in threaded post --- posts.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/posts.py b/posts.py index 346d05b7..42fc8420 100644 --- a/posts.py +++ b/posts.py @@ -1007,10 +1007,15 @@ def threadSendPost(session,postJsonStr: str,federationList: [],\ tries=0 backoffTime=60 for attempt in range(20): - postResult = \ - postJsonString(session,postJsonStr,federationList, \ - inboxUrl,signatureHeaderJson, \ - "inbox:write",debug) + 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: