mirror of
https://github.com/Team254/cheesy-arena-lite.git
synced 2026-03-10 06:06:47 -04:00
Suppress logging of common 'going away' websocket error.
This commit is contained in:
@@ -53,7 +53,8 @@ func (ws *Websocket) Close() error {
|
||||
func (ws *Websocket) Read() (string, interface{}, error) {
|
||||
var message Message
|
||||
err := ws.conn.ReadJSON(&message)
|
||||
if websocket.IsCloseError(err, websocket.CloseNoStatusReceived, websocket.CloseAbnormalClosure) {
|
||||
if websocket.IsCloseError(err, websocket.CloseAbnormalClosure, websocket.CloseGoingAway,
|
||||
websocket.CloseNoStatusReceived) {
|
||||
// This error indicates that the browser terminated the connection normally; rewrite it so that clients don't
|
||||
// log it.
|
||||
return "", nil, io.EOF
|
||||
|
||||
Reference in New Issue
Block a user