-
Notifications
You must be signed in to change notification settings - Fork 13k
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
errno ignored for unix getaddrinfo #36546
Comments
Sounds reasonable to me! Should hopefully be more tackle-able once rust-lang/libc#402 lands. |
ghost
mentioned this issue
Sep 26, 2016
sophiajt
pushed a commit
to sophiajt/rust
that referenced
this issue
Sep 27, 2016
…richton When getaddrinfo returns EAI_SYSTEM retrieve actual error from errno. Fixes issue rust-lang#36546. This change also updates libc to earliest version that includes EAI_SYSTEM constant. Previously, in cases where `EAI_SYSTEM` has been returned from getaddrinfo, the resulting `io::Error` would be broadly described as "System error": Error { repr: Custom(Custom { kind: Other, error: StringError("failed to lookup address information: System error") }) } After change a more detailed error is crated based on particular value of errno, for example: Error { repr: Os { code: 64, message: "Machine is not on the network" } } The only downside is that the prefix "failed to lookup address information" is no longer included in the error message.
I think this was closed by #36754. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When
getaddrinfo()
fails, the wrapper produces a customio::Error
usinggai_strerror()
. There's one variant which essentially says just look at errno.But
libstd
doesn't do that which leads to very unhelpful errors.It would be great if the error value could be checked for
EAI_SYSTEM
, provide thestrerror()
message in theStringError
value, and setKind
appropriately.The text was updated successfully, but these errors were encountered: