api/handler/rpc: dont log error on normal websocket error code (#1688)

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2020-06-06 00:03:43 +03:00 committed by GitHub
parent bbc3b7040b
commit 6c7bcf3883
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -185,7 +185,11 @@ func writeLoop(rw io.ReadWriter, stream client.Stream) {
if err != nil { if err != nil {
if wserr, ok := err.(wsutil.ClosedError); ok { if wserr, ok := err.(wsutil.ClosedError); ok {
switch wserr.Code { switch wserr.Code {
case ws.StatusGoingAway:
// this happens when user leave the page
return
case ws.StatusNormalClosure, ws.StatusNoStatusRcvd: case ws.StatusNormalClosure, ws.StatusNoStatusRcvd:
// this happens when user close ws connection, or we don't get any status
return return
} }
} }