Skip to content

Commit 0b57dfa

Browse files
change to use error is notation
1 parent 5c97e02 commit 0b57dfa

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

pkg/cloud/gateway/gateway.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,9 +367,9 @@ 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, i.e. "websocket: close 1005 (no status)"
370+
// Won't print errors that arise if the socket is closed and are "going away" or "no status" errors
371371
_, message, err := ws.ReadMessage()
372-
if err != nil && strings.Contains(err.Error(), "no status") {
372+
if err != nil && websocket.IsCloseError(err, 1001, 1005) {
373373
break
374374
} else if err != nil {
375375
log.Println("read:", err)

0 commit comments

Comments
 (0)