Skip to content

Commit 4a92ab7

Browse files
authored
chore: Add error messages to return statements in BlockingDial function (#17521)
* Add error messages to return statements in BlockingDial function Signed-off-by: danqixu <[email protected]> * amend error wrapping from %s to %w Signed-off-by: danqixu <[email protected]> --------- Signed-off-by: danqixu <[email protected]>
1 parent 739fa0c commit 4a92ab7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

util/grpc/grpc.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package grpc
33
import (
44
"context"
55
"crypto/tls"
6+
"fmt"
67
"net"
78
"runtime/debug"
89
"strings"
@@ -67,13 +68,13 @@ func BlockingDial(ctx context.Context, network, address string, creds credential
6768
conn, err := proxy.Dial(ctx, network, address)
6869
if err != nil {
6970
writeResult(err)
70-
return nil, err
71+
return nil, fmt.Errorf("error dial proxy: %w", err)
7172
}
7273
if creds != nil {
7374
conn, _, err = creds.ClientHandshake(ctx, address, conn)
7475
if err != nil {
7576
writeResult(err)
76-
return nil, err
77+
return nil, fmt.Errorf("error creating connection: %w", err)
7778
}
7879
}
7980
return conn, nil

0 commit comments

Comments
 (0)