From 68e9d6e9818bd9b781be43a2e2b9759251c5975e Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Mon, 21 Nov 2022 22:45:26 +0200 Subject: [PATCH] Fix showing some types of errors in login screen Double fixes #402 --- ui/view-login.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ui/view-login.go b/ui/view-login.go index c648076..100a56c 100644 --- a/ui/view-login.go +++ b/ui/view-login.go @@ -166,10 +166,12 @@ func (view *LoginView) actuallyLogin(hs, mxid, password string) { view.Error(err.Error()) } else if err = view.matrix.Login(mxid, password); err != nil { if httpErr, ok := err.(mautrix.HTTPError); ok { - if httpErr.RespError != nil { + if httpErr.RespError != nil && len(httpErr.RespError.Err) > 0 { view.Error(httpErr.RespError.Err) - } else { + } else if len(httpErr.Message) > 0 { view.Error(httpErr.Message) + } else { + view.Error(err.Error()) } } else { view.Error(err.Error())