diff options
author | Drew DeVault <sir@cmpwn.com> | 2019-01-13 19:41:21 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-01-13 19:41:21 -0500 |
commit | f87fe502a6d252bac9da5f08fd2aa682a9fc2277 (patch) | |
tree | b9f2d5b8ddd077e93e82e70c95d968a2f42852e1 | |
parent | 4b350dddea99faad7450f292b6be036a0fe3220d (diff) | |
download | aerc-f87fe502a6d252bac9da5f08fd2aa682a9fc2277.zip |
Handle connection errors properly
-rw-r--r-- | widgets/account.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/widgets/account.go b/widgets/account.go index d99a21f..4411094 100644 --- 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) } } |