diff --git a/content.py b/content.py index 1508d8e1..ca5ba0e0 100644 --- a/content.py +++ b/content.py @@ -326,9 +326,9 @@ def addHtmlTags(baseDir: str,httpPrefix: str, \ if emojiDictCtr>0: print('emojiDict loaded on try '+str(emojiDictCtr)) break - except (IndexError, AttributeError, commentjson.JSONLibraryException) as e: - print('WARN: commentjson exception addHtmlTags - '+str(e)) - print('Failed to load emoji (try '+str(emojiDictCtr)+'): '+baseDir+'/emoji/emoji.json '+str(e)) + except: + print('WARN: commentjson exception addHtmlTags') + print('Failed to load emoji (try '+str(emojiDictCtr)+'): '+baseDir+'/emoji/emoji.json') time.sleep(1) emojiDictCtr+=1 diff --git a/inbox.py b/inbox.py index 684e51f2..0a2f6978 100644 --- a/inbox.py +++ b/inbox.py @@ -1727,9 +1727,9 @@ def runInboxQueue(projectVersion: str, \ try: with open(queueFilename, 'r') as fp: queueJson=commentjson.load(fp) - except (IndexError, AttributeError, commentjson.JSONLibraryException) as e: + except: itemReadFailed+=1 - print('WARN: commentjson exception runInboxQueue - '+str(e)) + print('WARN: commentjson exception runInboxQueue') print('WARN: Failed to load inbox queue item '+queueFilename+' (try '+str(itemReadFailed)+')') if itemReadFailed>4: # After a few tries we can assume that the file diff --git a/posts.py b/posts.py index 2cf86615..8e04003f 100644 --- a/posts.py +++ b/posts.py @@ -1927,8 +1927,8 @@ def createSharedInboxIndex(baseDir: str,sharedBoxDir: str, \ try: with open(sharedInboxFilename, 'r') as fp: postJsonObject=commentjson.load(fp) - except (IndexError, AttributeError, commentjson.JSONLibraryException) as e: - print('WARN: commentjson exception createBoxBase - '+str(e)) + except: + print('WARN: commentjson exception createBoxBase') continue actorNickname=getNicknameFromActor(postJsonObject['actor']) @@ -1963,8 +1963,8 @@ def createSharedInboxIndex(baseDir: str,sharedBoxDir: str, \ with open(ocapFilename, 'r') as fp: ocapJson=commentjson.load(fp) loadedOcap=True - except (IndexError, AttributeError, commentjson.JSONLibraryException) as e: - print('WARN: commentjson exception createBoxBase - '+str(e)) + except: + print('WARN: commentjson exception createBoxBase') if loadedOcap: if ocapJson.get('id'): diff --git a/utils.py b/utils.py index c9c0ba7e..f3c58a9d 100644 --- a/utils.py +++ b/utils.py @@ -37,8 +37,8 @@ def loadJson(filename: str) -> {}: with open(filename, 'r') as fp: jsonObject=commentjson.load(fp) break - except (IndexError, AttributeError, commentjson.JSONLibraryException) as e: - print('WARN: loadJson exception - '+str(e)) + except: + print('WARN: loadJson exception') time.sleep(2) tries+=1 return jsonObject @@ -127,8 +127,8 @@ def getDisplayName(baseDir: str,actor: str,personCache: {}) -> str: with open(cachedActorFilename, 'r') as fp: actorJson=commentjson.load(fp) break - except (IndexError, AttributeError, commentjson.JSONLibraryException) as e: - print('WARN: getDisplayName '+str(e)) + except: + print('WARN: getDisplayName') time.sleep(1) tries+=1 if actorJson: @@ -300,8 +300,8 @@ def deletePost(baseDir: str,httpPrefix: str,nickname: str,domain: str,postFilena with open(postFilename, 'r') as fp: postJsonObject=commentjson.load(fp) break - except (IndexError, AttributeError, commentjson.JSONLibraryException) as e: - print('WARN: deletePost '+str(e)) + except: + print('WARN: deletePost') time.sleep(1) tries+=1