diff --git a/utils/wsutil/conn.go b/utils/wsutil/conn.go index baf65fa..6e001b7 100644 --- a/utils/wsutil/conn.go +++ b/utils/wsutil/conn.go @@ -6,6 +6,7 @@ import ( "context" "io" "net/http" + "strings" "time" "github.com/gorilla/websocket" @@ -167,6 +168,12 @@ func startReadLoop(conn *websocket.Conn, eventCh chan<- Event) { return } + // Is the error an intentional close call? Go 1.16 exposes + // ErrClosing, but we have to do this for now. + if strings.HasSuffix(err.Error(), "use of closed network connection") { + return + } + // Check if the error is a normal one: if websocket.IsCloseError(err, websocket.CloseNormalClosure) { return