-
Notifications
You must be signed in to change notification settings - Fork 845
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
Document internal RuntimeError
possible values
#1338
Comments
To add more context. We would like to have exhaustive non-overlapping categories of errors into which
(3) should be deterministic, meaning the same program executed on different platforms should return exactly the same error, assuming host functions have the same side effects. Currently, there is no way to differentiate (2), (3), and (4). Also
|
@nearmax That's a great breakdown -- thanks! I agree completely that an error type upgrade is in order here to fix this situation. 4 might be tricky. I'll have to look into it more, but as far as I can remember there is no way to handle OOM in general on stable Rust (notably allocation by default in Rust doesn't return an error type, it just panics). There may be a feature on nightly that will allow this to work though -- presumably people writing embedded Rust eventually need such a thing. If so, we can add features that only work on nightly to do this. In addition to this, or perhaps just being more explicit about an implementation detail, we should update all wasmer-internal errors to return a standardized type rather than ad-hoc strings. |
It's absolutely ok to panic if there is a hardware problem. We want to make sure that a hardware problem will not false-positively interpreted as a valid behavior. In short: we need to have a clear discriminator for errors which are defined by the spec (Wasm traps) and internal errors (like here wasmer/lib/runtime-core/src/error.rs Line 35 in eaa081e
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
There is now a separation between I believe it's solving this issue. I'm closing it. Feel free to reopen if you believe it's not enough! |
Brought to our attention in #1328:
RuntimeError should document that it can be returned by Wasmer's internal code and the a list of types that can be returned (so users can downcast them) should also be listed clearly in the docs.
We may want to additionally document this outside of the crate documentation
The text was updated successfully, but these errors were encountered: