🐛 catch another Exception (e.g. ValueError("Invalid Homeserver")) and try to reconnect
All checks were successful
ci / docker (push) Successful in 6m57s
Python formatting PEP8 / Python-PEP8 (push) Successful in 15s

This commit is contained in:
Finn Christiansen 2024-11-19 22:41:29 +01:00
parent 01b34783cf
commit cb451f02af

View file

@ -117,9 +117,9 @@ The link will be valid for 7 days.""".format(os.getenv("REGISTRATION_URL") + res
while True:
try:
bot.run()
except ServerDisconnectedError:
time.sleep(5)
except (ServerDisconnectedError, ValueError):
logging.info("connection lost, reconnecting in 5 seconds...")
time.sleep(5)
except KeyboardInterrupt:
logging.info("exiting...")
sys.exit(0)