From 6a4ef1ee15e2d060c0e5bf818c1beae0d05881b6 Mon Sep 17 00:00:00 2001 From: danqixu <156804971+danqixu@users.noreply.github.com> Date: Wed, 13 Mar 2024 23:33:40 -0400 Subject: [PATCH] chore: Add error messages to return statements in BlockingDial function (#17521) * Add error messages to return statements in BlockingDial function Signed-off-by: danqixu * amend error wrapping from %s to %w Signed-off-by: danqixu --------- Signed-off-by: danqixu Signed-off-by: Mangaal --- util/grpc/grpc.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/util/grpc/grpc.go b/util/grpc/grpc.go index 536da792e3048..a4f920e40252e 100644 --- a/util/grpc/grpc.go +++ b/util/grpc/grpc.go @@ -3,6 +3,7 @@ package grpc import ( "context" "crypto/tls" + "fmt" "net" "runtime/debug" "strings" @@ -67,13 +68,13 @@ func BlockingDial(ctx context.Context, network, address string, creds credential conn, err := proxy.Dial(ctx, network, address) if err != nil { writeResult(err) - return nil, err + return nil, fmt.Errorf("error dial proxy: %w", err) } if creds != nil { conn, _, err = creds.ClientHandshake(ctx, address, conn) if err != nil { writeResult(err) - return nil, err + return nil, fmt.Errorf("error creating connection: %w", err) } } return conn, nil