From 50aa8e9c3087e2c8ba742e64fb38eb22b7b3cd0a Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Sat, 17 Aug 2024 01:29:12 +0200 Subject: [PATCH] improve error handling Signed-off-by: Ettore Di Giacinto --- core/p2p/p2p.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/p2p/p2p.go b/core/p2p/p2p.go index 86bc5261f6c1..5d11f10565ff 100644 --- a/core/p2p/p2p.go +++ b/core/p2p/p2p.go @@ -239,8 +239,10 @@ func ensureService(ctx context.Context, n *node.Node, nd *NodeData, sserv string // Start the service port, err := freeport.GetFreePort() if err != nil { - fmt.Print(err) + zlog.Error().Err(err).Msgf("Could not allocate a free port for %s", nd.ID) + return } + tunnelAddress := fmt.Sprintf("127.0.0.1:%d", port) nd.TunnelAddress = tunnelAddress service[nd.Name] = nodeServiceData{