From e3e1189542d4d35b701c7f3a70571a255aeea909 Mon Sep 17 00:00:00 2001 From: Justin Date: Fri, 6 Sep 2024 17:04:02 -0500 Subject: [PATCH] Raise error on login fail --- fractal/matrix/admin_client.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fractal/matrix/admin_client.py b/fractal/matrix/admin_client.py index e09fc2e..4297e20 100644 --- a/fractal/matrix/admin_client.py +++ b/fractal/matrix/admin_client.py @@ -4,6 +4,7 @@ import requests from asgiref.sync import async_to_sync +from nio import LoginError class MatrixAdminClient: @@ -115,6 +116,8 @@ async def alogin(self, user_id, password): async with MatrixClient(self.homeserver_url) as client: client.user = user_id result = await client.login(password) + if isinstance(result, LoginError): + raise Exception(result) return result.user_id, result.access_token def login(self, user_id, password):