Skip to content

Commit

Permalink
Print log message
Browse files Browse the repository at this point in the history
  • Loading branch information
nak3 committed Dec 11, 2023
1 parent 1265f14 commit 6db907c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -1158,7 +1158,10 @@ func (c *Conn) SetCloseHandler(h func(code int, text string) error) {
if h == nil {
h = func(code int, text string) error {
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
}
}
Expand Down

0 comments on commit 6db907c

Please sign in to comment.