Skip to content

Commit

Permalink
fix: handle websocket closed error in servicer client listener
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanchriswhite committed Sep 19, 2023
1 parent 9705345 commit 4ce5795
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions relayer/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ func (client *servicerClient) listen(ctx context.Context, newBlocks chan types.B

_, msg, err := client.wsClient.ReadMessage()
if err != nil {
if websocket.IsUnexpectedCloseError(err) {
// NB: stop this goroutine if the websocket connection is closed
return
}
// TODO: handle error
continue
}
Expand Down

0 comments on commit 4ce5795

Please sign in to comment.