From 1b9fbdc0579347d88dee0388a3b67fe6e8f3d4c6 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Fri, 19 Nov 2021 08:49:58 -0800 Subject: [PATCH] cmd/tailscaled: disambiguate some startup failure error messages Updates #3351 Change-Id: I0afead4a084623567f56b19187574fa97b295b2a Signed-off-by: Brad Fitzpatrick (cherry picked from commit 5294125e7a5105d2673053d03715632cf8613674) --- cmd/tailscaled/tailscaled.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/tailscaled/tailscaled.go b/cmd/tailscaled/tailscaled.go index 3fd15b91c..bc4510b93 100644 --- a/cmd/tailscaled/tailscaled.go +++ b/cmd/tailscaled/tailscaled.go @@ -440,14 +440,14 @@ func tryEngine(logf logger.Logf, linkMon *monitor.Mon, name string) (e wgengine. log.Printf("Connecting to BIRD at %s ...", args.birdSocketPath) conf.BIRDClient, err = createBIRDClient(args.birdSocketPath) if err != nil { - return nil, false, err + return nil, false, fmt.Errorf("createBIRDClient: %w", err) } } if !useNetstack { dev, devName, err := tstun.New(logf, name) if err != nil { tstun.Diagnose(logf, name) - return nil, false, err + return nil, false, fmt.Errorf("tstun.New(%q): %w", name, err) } conf.Tun = dev if strings.HasPrefix(name, "tap:") { @@ -459,11 +459,11 @@ func tryEngine(logf logger.Logf, linkMon *monitor.Mon, name string) (e wgengine. r, err := router.New(logf, dev, linkMon) if err != nil { dev.Close() - return nil, false, err + return nil, false, fmt.Errorf("creating router: %w", err) } d, err := dns.NewOSConfigurator(logf, devName) if err != nil { - return nil, false, err + return nil, false, fmt.Errorf("dns.NewOSConfigurator: %w", err) } conf.DNS = d conf.Router = r