diff --git a/cmd/headscale/cli/utils.go b/cmd/headscale/cli/utils.go index 327c8c14..c07e3a25 100644 --- a/cmd/headscale/cli/utils.go +++ b/cmd/headscale/cli/utils.go @@ -55,6 +55,7 @@ func getHeadscaleCLIClient() (context.Context, v1.HeadscaleServiceClient, *grpc. Err(err). Caller(). Msgf("Failed to load configuration") + os.Exit(-1) // we get here if logging is suppressed (i.e., json output) } log.Debug(). @@ -116,6 +117,7 @@ func getHeadscaleCLIClient() (context.Context, v1.HeadscaleServiceClient, *grpc. conn, err := grpc.DialContext(ctx, address, grpcOptions...) if err != nil { log.Fatal().Caller().Err(err).Msgf("Could not connect: %v", err) + os.Exit(-1) // we get here if logging is suppressed (i.e., json output) } client := v1.NewHeadscaleServiceClient(conn)