RPC FFI: Expose OS errno if possible
Per discussion at !2273 (comment 3051380) , it would be neat if the FFI error type gave a way to access the corresponding OS error code (errno
, GetLastError()
, etc).
Doing this is complicated by the fact that RawOsError
is still an unstable API, so it's not clear that we have a great way to get the OS error out of an io::Error
. Would we have to call libc::errno()
whenever we construct an FfiError
, and hope that nothing intervening has happened? That might be bad.
Since the motivation here is to distinguish CONNREFUSED
from other stuff, it might be better to refactor our RPC STATUS
codes, and have them distinguish these cases?