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 <yzxudanqi@gmail.com>

* amend error wrapping from %s to %w

Signed-off-by: danqixu <yzxudanqi@gmail.com>

---------

Signed-off-by: danqixu <yzxudanqi@gmail.com>
Signed-off-by: Mangaal <angommeeteimangaal@gmail.com>
  • Loading branch information
danqixu authored and Mangaal committed Mar 14, 2024
1 parent b6d13b2 commit b835e83
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 b835e83

Please sign in to comment.