Skip to content

Commit

Permalink
Merge pull request #166 from yuzhiquan/bugfix-handle-error
Browse files Browse the repository at this point in the history
Handle resolve unix addr error
  • Loading branch information
BSWANG authored Dec 25, 2020
2 parents 70d3197 + 84b5c55 commit 224ee8c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func main() {
func(ctx context.Context, s string) (net.Conn, error) {
unixAddr, err := net.ResolveUnixAddr("unix", defaultSocketPath)
if err != nil {
return nil, nil
return nil, fmt.Errorf("error while resolve unix addr:%w", err)
}
d := net.Dialer{}
return d.DialContext(ctx, "unix", unixAddr.String())
Expand Down
2 changes: 1 addition & 1 deletion plugin/terway/cni.go
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ func getNetworkClient() (rpc.TerwayBackendClient, func(), error) {
func(ctx context.Context, s string) (net.Conn, error) {
unixAddr, err := net.ResolveUnixAddr("unix", defaultSocketPath)
if err != nil {
return nil, nil
return nil, fmt.Errorf("error while resolve unix addr:%w", err)
}
d := net.Dialer{}
return d.DialContext(timeoutCtx, "unix", unixAddr.String())
Expand Down

0 comments on commit 224ee8c

Please sign in to comment.