slack: check for unrecoverable EOF error

This commit is contained in:
cws 2017-04-01 09:14:29 -04:00
parent d582a294a5
commit 022f81a1f1
1 changed files with 4 additions and 1 deletions

View File

@ -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
}