mirror of
https://github.com/maubot/maubot.git
synced 2024-10-01 01:06:10 -04:00
Show any errors when logging in
This commit is contained in:
parent
66aef1978c
commit
adc762b9dd
@ -42,5 +42,8 @@ def login(server, username, password) -> None:
|
|||||||
save_config()
|
save_config()
|
||||||
print(Fore.GREEN + "Logged in successfully")
|
print(Fore.GREEN + "Logged in successfully")
|
||||||
except HTTPError as e:
|
except HTTPError as e:
|
||||||
if e.code == 401:
|
try:
|
||||||
print(Fore.RED + "Invalid username or password" + Fore.RESET)
|
err = json.load(e)
|
||||||
|
except json.JSONDecodeError:
|
||||||
|
err = {}
|
||||||
|
print(Fore.RED + err.get("error", str(e)) + Fore.RESET)
|
||||||
|
Loading…
Reference in New Issue
Block a user