Skip to content

Commit cada2b5

Browse files
fix: ignore no status websocket error on local run (#829)
1 parent 3826f1b commit cada2b5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/cloud/gateway/gateway.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,11 @@ func (s *LocalGatewayService) handleWebsocketRequest(socketName string) func(ctx
367367
// Need to create a unique ID for this connection and store in a central location
368368
// This will allow connected clients to message eachother and broadcast to all clients as well
369369
// We'll only read new messages on this connection here, writing will be done by a separate runtime API
370+
// Won't print errors that arise if the socket is closed and are "going away" or "no status" errors
370371
_, message, err := ws.ReadMessage()
371-
if err != nil {
372+
if err != nil && websocket.IsCloseError(err, 1001, 1005) {
373+
break
374+
} else if err != nil {
372375
log.Println("read:", err)
373376
break
374377
}

0 commit comments

Comments
 (0)