From 92e9d054324a8af542d2f208b82871521914acdb Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Sat, 6 Jun 2020 00:03:43 +0300 Subject: [PATCH] api/handler/rpc: dont log error on normal websocket error code (#1688) Signed-off-by: Vasiliy Tolstov --- api/handler/rpc/stream.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/handler/rpc/stream.go b/api/handler/rpc/stream.go index 87dc02ea..5f0b10aa 100644 --- a/api/handler/rpc/stream.go +++ b/api/handler/rpc/stream.go @@ -185,7 +185,11 @@ func writeLoop(rw io.ReadWriter, stream client.Stream) { if err != nil { if wserr, ok := err.(wsutil.ClosedError); ok { switch wserr.Code { + case ws.StatusGoingAway: + // this happens when user leave the page + return case ws.StatusNormalClosure, ws.StatusNoStatusRcvd: + // this happens when user close ws connection, or we don't get any status return } }