reorder
This commit is contained in:
parent
5570e53d99
commit
2ddac95715
1 changed files with 2 additions and 2 deletions
|
@ -108,9 +108,9 @@ func (ws *wsSession) Go() error {
|
||||||
for {
|
for {
|
||||||
_, rdr, err := ws.NextReader()
|
_, rdr, err := ws.NextReader()
|
||||||
switch {
|
switch {
|
||||||
|
case err == nil:
|
||||||
case websocket.IsCloseError(err, websocket.CloseGoingAway):
|
case websocket.IsCloseError(err, websocket.CloseGoingAway):
|
||||||
return nil
|
return nil
|
||||||
case err == nil:
|
|
||||||
case err != nil:
|
case err != nil:
|
||||||
log.Error().Err(err).Str("remote", ws.ec.Request().RemoteAddr).Msg("websocket read fail")
|
log.Error().Err(err).Str("remote", ws.ec.Request().RemoteAddr).Msg("websocket read fail")
|
||||||
return err
|
return err
|
||||||
|
@ -198,7 +198,7 @@ func (ws *cmdHandler) handleMsg(r io.Reader) error {
|
||||||
err = mapstructure.Decode(&msgMap, &nd)
|
err = mapstructure.Decode(&msgMap, &nd)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ws.writeError(id, Error{
|
ws.writeError(id, Error{
|
||||||
Code: "invalid_format",
|
Code: "invalid_format",
|
||||||
Message: err.Error(),
|
Message: err.Error(),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue