diff --git a/main.py b/main.py index 5dde52d..119ff54 100755 --- a/main.py +++ b/main.py @@ -96,6 +96,8 @@ if __name__ == '__main__': localservthread = LocalServer(store) localservthread.start() + ERRORS = 0 + while True: time.sleep(1) @@ -110,3 +112,10 @@ if __name__ == '__main__': xmpp.process() except KeyboardInterrupt: cleanExit() + except Exception as e: + log.error(str(e)) + if ERRORS >= 3: + log.critical("3 consecutive errors. Aborting...") + cleanExit() + + ERRORS += 1