From bdab5d192076471601396eb93d06750eb35920e9 Mon Sep 17 00:00:00 2001 From: Gregory Rudolph Date: Wed, 2 Oct 2019 11:00:10 -0400 Subject: [PATCH] Added error check on sendChat --- main.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 770177d..5734135 100644 --- a/main.go +++ b/main.go @@ -99,9 +99,12 @@ func populateChat(g *gocui.Gui) { } -func sendChat(message string) { +func sendChat(message string, g *gocui.Gui) { chat := k.NewChat(channel) - chat.Send(message) + _, err := chat.Send(message) + if err != nil { + printToView(g,"Feed",fmt.Sprintf("There was an error %+v", err)) + } } func formatOutput(api keybase.ChatAPI) string { ret := "" @@ -123,7 +126,7 @@ func uploadFile(g *gocui.Gui, filePath string, fileName string) { if err != nil { printToView(g, "Feed", fmt.Sprintf("There was an error uploading %s to %s", filePath, channel.Name)) } else { - printToView(g, "Feed", fmt.Sprintf("Uploaded %s to %s\n%+v", filePath, channel.Name, err)) + printToView(g, "Feed", fmt.Sprintf("Uploaded %s to %s", filePath, channel.Name)) } } func downloadFile(g *gocui.Gui, messageID int, fileName string) {