Skip to content

Commit

Permalink
fix: tty read loop, continue on error
Browse files Browse the repository at this point in the history
  • Loading branch information
behrangalavi committed Oct 10, 2023
1 parent 525f6e2 commit a322a13
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions operator/routes-websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func connectWs(c *gin.Context) {

tty, err := pty.Start(cmd)
if err != nil {
log.Printf("Unable to start pty/cmd")
log.Printf("Unable to start pty/cmd: %s", err.Error())
ws.WriteMessage(websocket.TextMessage, []byte(err.Error()))
return
}
Expand All @@ -90,7 +90,7 @@ func connectWs(c *gin.Context) {
if err != nil {
ws.WriteMessage(websocket.TextMessage, []byte(err.Error()))
log.Printf("Unable to read from pty/cmd: %s", err.Error())
return
continue
}
ws.WriteMessage(websocket.BinaryMessage, buf[:read])
}
Expand Down

0 comments on commit a322a13

Please sign in to comment.