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

No way to communicate richer error information #146

Open
alexcrichton opened this issue Jun 25, 2020 · 0 comments
Open

No way to communicate richer error information #146

alexcrichton opened this issue Jun 25, 2020 · 0 comments

Comments

@alexcrichton
Copy link

Currently the C API provides no means of communicating rich error information (e.g. strings/class/code/etc) which isn't a trap. For example wasm_module_validate only allows returning a bool whereas engines probably have more rich information such as a string and an offset the error applies to. For an embedding using the C API it's often critical to end-users to be able to see what went wrong when something goes wrong, so it would be nice to have the ability to thread through this information.

Depending on the outcome of #132 this may also apply to many other APIs as well. For example wasm_instance_new could fail for a whole host of reasons (such as link errors), and it will be useful to communicate this to callers.

For now I think a string (wrapped up in a new error type) is good enough, but this also provides a location for future improvements, such as getting the error offset into the wasm binary for validation, for example.

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

No branches or pull requests

1 participant