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

Tidy up the WASI ErrorKind enum. #5015

Merged

Conversation

sunfishcode
Copy link
Member

ErrorKind is an internal enum used in wasi-libc to represent WASI errors that aren't precisely represened by std::io::ErrorKind errors. Add a descriptive comment, and remove some codes that are no longer needed:

  • Remove NotCapable, which is no longer used.
  • Remove WouldBlk, Exist, Noent, and Inval, which have one-to-one correspondences with codes in std::io::ErrorKind.

This will simplify the error handling in #4947 and #4967, as it means the code will no longer have to check for two different forms of these errors.

`ErrorKind` is an internal enum used in wasi-libc to represent WASI
errors that aren't precisely represened by `std::io::ErrorKind` errors.
Add a descriptive comment, and remove some codes that are no longer
needed:

 - Remove `NotCapable`, which is no longer used.
 - Remove `WouldBlk`, `Exist`, `Noent`, and `Inval`, which have
   one-to-one correspondences with codes in `std::io::ErrorKind`.

This will simplify the error handling in bytecodealliance#4947 and bytecodealliance#4967, as it means
the code will no longer have to check for two different forms of these
errors.
@github-actions github-actions bot added the wasi Issues pertaining to WASI label Oct 5, 2022
@github-actions
Copy link

github-actions bot commented Oct 5, 2022

Subscribe to Label Action

cc @kubkon

This issue or pull request has been labeled: "wasi"

Thus the following users have been cc'd because of the following labels:

  • kubkon: wasi

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

@alexcrichton alexcrichton merged commit 24da5f7 into bytecodealliance:main Oct 5, 2022
@sunfishcode sunfishcode deleted the sunfishcode/error-kind branch October 5, 2022 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wasi Issues pertaining to WASI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants