File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -535,6 +535,18 @@ func (rc *RobotClient) connectWithLock(ctx context.Context) error {
535535 conn = grpcConn
536536 err = nil
537537 } else {
538+ // A context.DeadlineExceeded from the WebRTC dial implies the client is unable to reach
539+ // the signaling server, which likely means that the client is offline. In that case, if the errors returned from
540+ // grpc dials are also timeouts or mDNS failing to find a candidate, we should remind clients to double-check their internet
541+ // connection and that the machine is on. This should be more helpful than simply returning a chain of context.DeadlineExceeded
542+ // and candidate not found errors.
543+ const connTimeoutURL = "https://docs.viam.com/dev/tools/common-errors/#conn-time-out"
544+ if errors .Is (err , context .DeadlineExceeded ) &&
545+ errors .Is (grpcErr , context .DeadlineExceeded ) &&
546+ errors .Is (grpcErr , rpc .ErrMDNSNoCandidatesFound ) {
547+ return fmt .Errorf ("failed to connect to machine within time limit. check network connection, whether the viam-server is running, " +
548+ "and try again. see " + connTimeoutURL + " for troubleshooting steps" )
549+ }
538550 err = multierr .Combine (err , grpcErr )
539551 }
540552 }
You can’t perform that action at this time.
0 commit comments