mirror of https://github.com/gorilla/websocket.git
Print log message
This commit is contained in:
parent
4965080703
commit
7d5b8cce7e
5
conn.go
5
conn.go
|
@ -1158,7 +1158,10 @@ func (c *Conn) SetCloseHandler(h func(code int, text string) error) {
|
||||||
if h == nil {
|
if h == nil {
|
||||||
h = func(code int, text string) error {
|
h = func(code int, text string) error {
|
||||||
message := FormatCloseMessage(code, "")
|
message := FormatCloseMessage(code, "")
|
||||||
_ = c.WriteControl(CloseMessage, message, time.Now().Add(writeWait))
|
err := c.WriteControl(CloseMessage, message, time.Now().Add(writeWait))
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("websocket: discarding close handler error: %v", err)
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue