diff --git a/client/comms/wsconn.go b/client/comms/wsconn.go index 046d041c10..88d59d644d 100644 --- a/client/comms/wsconn.go +++ b/client/comms/wsconn.go @@ -10,6 +10,7 @@ import ( "encoding/json" "errors" "fmt" + "math/rand" "net" "net/http" "net/url" @@ -259,6 +260,11 @@ func (conn *wsConn) connect(ctx context.Context) error { dialer.Proxy = http.ProxyFromEnvironment } + // TODO + if rand.Intn(3) != 0 { + return fmt.Errorf("DUMMY CONNECT ERRRRRRR") + } + ws, _, err := dialer.DialContext(ctx, conn.url(), conn.cfg.ConnectHeaders) if err != nil { if isErrorInvalidCert(err) { @@ -440,6 +446,12 @@ func (conn *wsConn) read(ctx context.Context) { return } + // TODO + if rand.Intn(40) == 0 { + conn.handleReadError(fmt.Errorf("DUMMY READ ERRRRRR")) + return + } + // If the message is a response, find the handler. if msg.Type == msgjson.Response { handler := conn.respHandler(msg.ID)