Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When AFD is unsupported, return an error that can be traced back to the original I/O error #174

Closed
notgull opened this issue Jan 8, 2024 · 0 comments · Fixed by #175
Closed

Comments

@notgull
Copy link
Member

notgull commented Jan 8, 2024

Before we use the Windows IOCP backend we quickly test to see if the AFD hack is available. If it isn't we return an error that mentions old Windows or WINE, in order to indicate that this is the likely cause.

However, it would be nice if we instead returned an io:Error that wraps a custom error struct. It would still have the nice message but it's source() would be the underlying I/O error.

notgull added a commit that referenced this issue Jan 8, 2024
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

Signed-off-by: John Nunley <dev@notgull.net>
notgull added a commit that referenced this issue Jan 9, 2024
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

Signed-off-by: John Nunley <dev@notgull.net>
@notgull notgull mentioned this issue Jan 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant