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

introduce wasi.Errno type and switch error codes to constants #72

Merged
merged 2 commits into from
Dec 12, 2021

Conversation

achille-roussel
Copy link
Collaborator

@achille-roussel achille-roussel commented Dec 10, 2021

This PR implements the changes discussed in #64

I modified the original proposal a bit so that the Error method will return the name of the error code rather than the numeric code, the intent being to be more meaningful when reading formatted errors in application logs.

Let me know if you have any comments!

resolves #64

Copy link
Member

@mathetake mathetake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you @achille-roussel for your contribution!🏅

@mathetake mathetake merged commit 5c23040 into tetratelabs:main Dec 12, 2021
@codefromthecrypt
Copy link
Contributor

fyi we had to revert this to ErrnoName because all errnos are not errors (ex errnosuccess isn't an error), plus we have some thinking to do wrt how to allow host functions to raise errors #258. Finally, the type alias complicates things like reflection, and generation which are easier if only use go types

ps if you are using something besides tinygo and/or need a WASI API not defined here, please pipe up in the issue #271

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add wasi.Errno type implementing the error interface
3 participants