Skip to content

Commit

Permalink
remove empty err message check
Browse files Browse the repository at this point in the history
  • Loading branch information
illia-malachyn committed Nov 29, 2024
1 parent 495cf03 commit 8496af3
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions engine/access/rest/websockets/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package websockets
import (
"context"
"encoding/json"
"errors"
"fmt"
"sync"

Expand All @@ -16,8 +15,6 @@ import (
"github.com/onflow/flow-go/utils/concurrentmap"
)

var ErrEmptyMessage = errors.New("empty message")

type Controller struct {
logger zerolog.Logger
config Config
Expand Down Expand Up @@ -97,8 +94,6 @@ func (c *Controller) readMessages(ctx context.Context) {
if websocket.IsCloseError(err, websocket.CloseNormalClosure, websocket.CloseAbnormalClosure) ||
websocket.IsUnexpectedCloseError(err, websocket.CloseNormalClosure, websocket.CloseGoingAway) {
return
} else if errors.Is(err, ErrEmptyMessage) {
continue
}

c.logger.Debug().Err(err).Msg("error reading message from client")
Expand Down Expand Up @@ -126,10 +121,6 @@ func (c *Controller) readMessage() (json.RawMessage, error) {
return nil, fmt.Errorf("error reading JSON from client: %w", err)
}

if message == nil {
return nil, ErrEmptyMessage
}

return message, nil
}

Expand Down

0 comments on commit 8496af3

Please sign in to comment.