Skip to content

Commit a96c64a

Browse files
committed
Improve error message on healthcheck faiure
1 parent cdba66b commit a96c64a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

cmd/connect.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func runConnect(cmd *cobra.Command, args []string) error {
9292

9393
log.Println("Connected...")
9494
if !client.CheckConnection(healthCheckTimeout, ctx) {
95-
return fmt.Errorf("connection immediately turned bad after connecting: %v", err)
95+
return fmt.Errorf("connection failed initial healthcheck after %v", healthCheckTimeout)
9696
}
9797

9898
for {

lib/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func (c *Client) updateInterface(resp connectResponse) error {
9393
if cidr != c.wgCidr {
9494
link := c.link()
9595

96-
if c.wgCidr != (netip.Prefix{}) {
96+
if c.wgCidr.IsValid() {
9797
oldIpnet := prefixToIPNet(c.wgCidr)
9898
err = netlink.AddrDel(link, &netlink.Addr{IPNet: &oldIpnet})
9999

0 commit comments

Comments
 (0)