-
Notifications
You must be signed in to change notification settings - Fork 10
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
Implement WASI error-handling #152
Conversation
src/wasi/Wasi.cpp
Outdated
namespace Walrus { | ||
|
||
std::string WASI::m_wasiErrorMessage[WASI::wasi_errno::notcapable + 1]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that this string list is not used at all.
Would it be used later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to use it to somehow communicate errors to the users of these functions, but I was unsure how you would like this part of wasi, so for the time being I left it it. It contains all the error messages in pairs with the error codes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
walrus
aims to be a lightweight WASM engine for resource-limited devices.
So, allocating a global array just for error messages does not fit in our goal.
If you really need this array, please use it with debug mode only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have removed the global array, but left in the messages without any storage, in case we would like it to use it in debug mode in the future when more WASI functions are implemented.
b41d5ed
to
5324814
Compare
Signed-off-by: Adam Laszlo Kulcsar <[email protected]>
5324814
to
93bc9e3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
https://github.com/WebAssembly/WASI/blob/main/legacy/preview1/docs.md#-errno-variant
Implement simple error-handling according to WASI documentation where functions return an error code as their first result and after that their usual results.