Skip to content

Commit

Permalink
Raise error on login fail
Browse files Browse the repository at this point in the history
  • Loading branch information
justin-russell committed Sep 6, 2024
1 parent f9820aa commit e3e1189
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fractal/matrix/admin_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import requests
from asgiref.sync import async_to_sync
from nio import LoginError


class MatrixAdminClient:
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit e3e1189

Please sign in to comment.