From cc52e39ce4d8d259583f3d6b293bfd239b4877cd Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Sat, 17 Dec 2022 01:00:49 +0100 Subject: [PATCH] Make some errors non-fatal. Don't disconnect the client for some more errors. --- rtpconn/webclient.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rtpconn/webclient.go b/rtpconn/webclient.go index e5e1f3b..f4a848f 100644 --- a/rtpconn/webclient.go +++ b/rtpconn/webclient.go @@ -1393,7 +1393,7 @@ func handleClientMessage(c *webClient, m clientMessage) error { case "join": if m.Kind == "leave" { if c.group == nil || c.group.Name() != m.Group { - return group.ProtocolError("you are not joined") + return group.UserError("you are not joined") } leaveGroup(c) } @@ -1691,7 +1691,7 @@ func handleClientMessage(c *webClient, m clientMessage) error { } g.UpdateData(data) default: - return group.ProtocolError("unknown group action") + return group.UserError("unknown group action") } case "useraction": g := c.group @@ -1753,7 +1753,7 @@ func handleClientMessage(c *webClient, m clientMessage) error { } }(g.GetClients(nil)) default: - return group.ProtocolError("unknown user action") + return group.UserError("unknown user action") } case "pong": // nothing