mirror of https://github.com/velour/catbase.git
slack: check for unrecoverable EOF error
This commit is contained in:
parent
d582a294a5
commit
022f81a1f1
|
@ -7,6 +7,7 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"html"
|
"html"
|
||||||
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
@ -148,7 +149,9 @@ func (s *Slack) Serve() {
|
||||||
s.connect()
|
s.connect()
|
||||||
for {
|
for {
|
||||||
msg, err := s.receiveMessage()
|
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)
|
log.Printf("Slack API error: %s", err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue