Don't log 1006 error in chat example

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

Fixes #323
This commit is contained in:
Gary Burd 2018-01-09 12:15:58 -08:00 committed by GitHub
parent d965e9adc6
commit 58729a2165
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

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