From 2ddac95715f36b6bfe5e3d2651b8e46fe71b30bc Mon Sep 17 00:00:00 2001 From: Daniel Ponte Date: Tue, 20 Dec 2022 21:24:14 -0500 Subject: [PATCH] reorder --- pkg/wsapi/api.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/wsapi/api.go b/pkg/wsapi/api.go index 5ecd3f8..9615258 100644 --- a/pkg/wsapi/api.go +++ b/pkg/wsapi/api.go @@ -108,9 +108,9 @@ func (ws *wsSession) Go() error { for { _, rdr, err := ws.NextReader() switch { + case err == nil: case websocket.IsCloseError(err, websocket.CloseGoingAway): return nil - case err == nil: case err != nil: log.Error().Err(err).Str("remote", ws.ec.Request().RemoteAddr).Msg("websocket read fail") return err @@ -198,7 +198,7 @@ func (ws *cmdHandler) handleMsg(r io.Reader) error { err = mapstructure.Decode(&msgMap, &nd) if err != nil { ws.writeError(id, Error{ - Code: "invalid_format", + Code: "invalid_format", Message: err.Error(), })