Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions robot/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,18 @@ func (rc *RobotClient) connectWithLock(ctx context.Context) error {
conn = grpcConn
err = nil
} else {
// A context.DeadlineExceeded from the WebRTC dial implies the client is unable to reach
// the signaling server, which likely means that the client is offline. In that case, if the errors returned from
// grpc dials are also timeouts or mDNS failing to find a candidate, we should remind clients to double-check their internet
// connection and that the machine is on. This should be more helpful than simply returning a chain of context.DeadlineExceeded
// and candidate not found errors.
const connTimeoutURL = "https://docs.viam.com/dev/tools/common-errors/#conn-time-out"
if errors.Is(err, context.DeadlineExceeded) &&
errors.Is(grpcErr, context.DeadlineExceeded) &&
errors.Is(grpcErr, rpc.ErrMDNSNoCandidatesFound) {
return fmt.Errorf("failed to connect to machine within time limit. check network connection, whether the viam-server is running, " +
"and try again. see " + connTimeoutURL + " for troubleshooting steps")
}
err = multierr.Combine(err, grpcErr)
}
}
Expand Down
Loading