aerc

Working clone of aerc-mail.org
git clone git://git.danielmoch.com/aerc.git
Log | Files | Refs | README | LICENSE

commit f87fe502a6d252bac9da5f08fd2aa682a9fc2277
parent 4b350dddea99faad7450f292b6be036a0fe3220d
Author: Drew DeVault <sir@cmpwn.com>
Date:   Sun, 13 Jan 2019 19:41:21 -0500

Handle connection errors properly

Diffstat:
Mwidgets/account.go | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/widgets/account.go b/widgets/account.go @@ -77,6 +77,7 @@ func NewAccountView( worker.PostAction(&types.Configure{Config: conf}, nil) worker.PostAction(&types.Connect{}, acct.connected) + statusline.Set("Connecting...") return acct } @@ -145,9 +146,9 @@ func (acct *AccountView) connected(msg types.WorkerMessage) { Message: types.RespondTo(msg), Approved: true, }, acct.connected) - default: - acct.logger.Println("Connection failed.") - acct.statusline.Set("Connection failed."). + case *types.Error: + acct.logger.Printf("%v", msg.Error) + acct.statusline.Set(fmt.Sprintf("%v", msg.Error)). Color(tcell.ColorRed, tcell.ColorDefault) } }