From d94c04b5bbf73a1ef468d1bb3d612031836a00b4 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 23 Jun 2020 15:48:10 +0100 Subject: [PATCH] Exception handling while starting followers thread --- posts.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/posts.py b/posts.py index da1a45e7..87eab77e 100644 --- a/posts.py +++ b/posts.py @@ -2167,7 +2167,16 @@ def sendToFollowersThread(session, baseDir: str, cachedWebfingers, personCache, postJsonObject.copy(), debug, projectVersion), daemon=True) - sendThread.start() + try: + sendThread.start() + except SocketError as e: + print('WARN: socket error while starting ' + + 'thread to send to followers. ' + str(e)) + return None + except BaseException: + print('WARN: error while starting ' + + 'thread to send to followers. ' + str(e)) + return None return sendThread