Skip to content
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

Correct host in ConnectError #1937

Closed
wants to merge 1 commit into from
Closed

Conversation

ndtretyak
Copy link

Added *fallbackConfig to ConnectError to have the correct host in the error message.
See #1929

}

if len(fallbackConfigs) == 0 {
return nil, &ConnectError{Config: config, msg: "hostname resolving error", err: errors.New("ip addr wasn't found")}
return nil, &ConnectError{Config: config, fallbackConfig: fallbackConfigs[0], msg: "hostname resolving error", err: errIPAddrNotFound}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems referencing fallbackConfigs[0] when len(fallbackConfigs) == 0 would always panic.

@jackc
Copy link
Owner

jackc commented Mar 16, 2024

Also, it appears that the change as a whole would make all error messages display the resolved IP address in exclusion of the name the IP was resolved from. This seems undesirable.

@ndtretyak ndtretyak closed this Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants