From 022f81a1f1092de654b174cc7ce2cddcf092ed4f Mon Sep 17 00:00:00 2001 From: cws Date: Sat, 1 Apr 2017 09:14:29 -0400 Subject: [PATCH] slack: check for unrecoverable EOF error --- slack/slack.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/slack/slack.go b/slack/slack.go index 3a00df5..9dc9a8c 100644 --- a/slack/slack.go +++ b/slack/slack.go @@ -7,6 +7,7 @@ import ( "encoding/json" "fmt" "html" + "io" "io/ioutil" "log" "net/http" @@ -148,7 +149,9 @@ func (s *Slack) Serve() { s.connect() for { msg, err := s.receiveMessage() - if err != nil { + if err != nil && err == io.EOF { + log.Fatalf("Slack API EOF") + } else if err != nil { log.Printf("Slack API error: %s", err) continue }