Skip to content

Commit

Permalink
chore: Add error messages to return statements in BlockingDial functi…
Browse files Browse the repository at this point in the history
…on (argoproj#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]>
  • Loading branch information
danqixu authored Mar 14, 2024
1 parent 739fa0c commit 4a92ab7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions util/grpc/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package grpc
import (
"context"
"crypto/tls"
"fmt"
"net"
"runtime/debug"
"strings"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4a92ab7

Please sign in to comment.