Description
First, os::strerror should be deleted (at least on Windows), and errno should almost never be used, instead preferring ErrnoError.
Second, WindowsError and WSASocketError are redundant. They are distinguishable only in that the former calls GetLastError and the latter calls WSAGetLastError, but these functions are aliases of each other. This abstraction also introduced the redundant SocketError, which is aliased to ErrnoError on Linux and WSASocketError on Windows. With Windows no longer using the CRT, we could conceivably have a SystemError which is correctly Errno or Windows depending on the platform.
Third, but this is unlikely to happen, Try<T, Error> should start returning the Error instead of the string, as we frequently need access to its code, but can't get it because Try is unfortunately wired to instead return the error message string if it's typed on Error. This is bizarre because it will return the Error class if it's instead Try<T, ErrnoError> etc. If we could also get the Error back, we could stop writing code that checks errno on POSIX and GetLastError() on Windows manually.
Attachments
Issue Links
- is blocked by
-
MESOS-8764 Delete WindowsSocketError and reconcile with SocketError and WindowsError
- Open