try reconnections on LocalProtocolError, fix #132

This commit is contained in:
Guilhem Saurel 2024-03-06 17:51:53 +01:00
parent 3325a63909
commit 9deea93d43

View File

@ -59,6 +59,9 @@ async def join_room(room_id):
except LocalProtocolError as e:
msg = f"Send error: {e}"
LOGGER.error(msg)
LOGGER.warning("Reconnecting")
if conf.MATRIX_PW:
await CLIENT.login(conf.MATRIX_PW)
LOGGER.warning("Trying again")
return create_json_response(HTTPStatus.GATEWAY_TIMEOUT, "Homeserver not responding")