Преглед изворни кода

Don't log 1006 error in chat example

This error is expected (Safari closes connections without sending a close
frame).

Fixes #323
Gary Burd пре 8 година
родитељ
комит
58729a2165
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      examples/chat/client.go

+ 1 - 1
examples/chat/client.go

@@ -64,7 +64,7 @@ func (c *Client) readPump() {
 	for {
 		_, message, err := c.conn.ReadMessage()
 		if err != nil {
-			if websocket.IsUnexpectedCloseError(err, websocket.CloseGoingAway) {
+			if websocket.IsUnexpectedCloseError(err, websocket.CloseGoingAway, websocket.CloseAbnormalClosure) {
 				log.Printf("error: %v", err)
 			}
 			break