You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
getaddrinfo (POSIX, Windows) errors are not set into errno, but returned to the caller. The implementation of Unix.getaddrinfo doesn't report errors to the OCaml side and returns an empty list instead.
Errors codes returned from getaddrinfo are distinct from errno errors and likely shouldn't be mapped (contrary to, for examples, error code of the POSIX threads API). Maybe a distinct Unix.addrinfo_error exception type should be added?
Note that on POSIX platforms, if EAI_SYSTEM is returned, then errno should be checked to report system errors (not specific to getaddrinfo). This would also mean raising a Unix.unix_error in this case.
Should these two points be considered? Is introducing an exception a breaking change, frowned upon? Another option would be to failwith a string, like in Unix.map_file.
The remarks also apply to getnameinfo and related. Error reporting has been missing since the introduction of IPv6 in OCaml 21 years ago, so that's probably not a hot topic.
The text was updated successfully, but these errors were encountered:
getaddrinfo
(POSIX, Windows) errors are not set intoerrno
, but returned to the caller. The implementation ofUnix.getaddrinfo
doesn't report errors to the OCaml side and returns an empty list instead.Errors codes returned from
getaddrinfo
are distinct fromerrno
errors and likely shouldn't be mapped (contrary to, for examples, error code of the POSIX threads API). Maybe a distinctUnix.addrinfo_error
exception type should be added?Note that on POSIX platforms, if
EAI_SYSTEM
is returned, thenerrno
should be checked to report system errors (not specific togetaddrinfo
). This would also mean raising aUnix.unix_error
in this case.Should these two points be considered? Is introducing an exception a breaking change, frowned upon? Another option would be to
failwith
a string, like inUnix.map_file
.The remarks also apply to
getnameinfo
and related. Error reporting has been missing since the introduction of IPv6 in OCaml 21 years ago, so that's probably not a hot topic.The text was updated successfully, but these errors were encountered: