smol-rs / polling

Portable interface to epoll, kqueue, event ports, and wepoll
Apache License 2.0
551 stars 68 forks source link

AFD failure now sources underlying I/O error #175

Closed notgull closed 10 months ago

notgull commented 10 months ago

Previously, if AFD failed to initialize polling would return a custom I/O error with a string error, containing the formatted version of the underlying system error. However, this means that information about the underlying system error is lost to the user.

This commit makes it so the returned io::Error wraps a user inaccessible type: AfdError. This AfdError, when stringified, returns a similar error message as what was previously returned. In addition when .source() is used it returns the underlying system error.

Closes #174