When getaddrinfo() fails, the wrapper produces a custom io::Error using gai_strerror(). There's one variant which essentially says just look at errno.
EAI_SYSTEM system error returned in errno
But libstd doesn't do that which leads to very unhelpful errors.
Io(Error { repr: Custom(Custom { kind: Other, error: StringError("failed to lookup address information: System error") }) }))
It would be great if the error value could be checked for EAI_SYSTEM, provide the strerror() message in the StringError value, and set Kind appropriately.
When
getaddrinfo()fails, the wrapper produces a customio::Errorusinggai_strerror(). There's one variant which essentially says just look at errno.But
libstddoesn'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 theStringErrorvalue, and setKindappropriately.