Skip to content

Fix error messages for test-client in UDS mode #732

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cmd/test-client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,13 @@ func (o *GrpcProxyClientOptions) Validate() error {
}
if o.proxyUdsName != "" {
if o.proxyHost != "" {
return fmt.Errorf("please do set proxy host when using UDS")
return fmt.Errorf("please set proxy host to \"\" when using UDS")
}
if o.proxyPort != 0 {
return fmt.Errorf("please do set proxy server port to 0 not %d when using UDS", o.proxyPort)
return fmt.Errorf("please set proxy server port to 0 when using UDS")
}
if o.clientKey != "" || o.clientCert != "" || o.caCert != "" {
return fmt.Errorf("please do set cert materials when using UDS, key = %s, cert = %s, CA = %s",
return fmt.Errorf("please do not set cert materials when using UDS, key = %s, cert = %s, CA = %s",
o.clientKey, o.clientCert, o.caCert)
}
}
Expand Down Expand Up @@ -231,7 +231,7 @@ type Client struct {
func (c *Client) run(o *GrpcProxyClientOptions) error {
o.Print()
if err := o.Validate(); err != nil {
return fmt.Errorf("failed to validate proxy client options, got %v", err)
return fmt.Errorf("failed to validate proxy client options, got: %w", err)
}

// Run remote simple http service on server side as
Expand Down