-
Notifications
You must be signed in to change notification settings - Fork 6
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
catch syscall errors #14
Conversation
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 like how this is going so far. I would use exceptions to throw errors after calling generic abort... what do you think?
Yeah that would make sense to throw errors |
We should now properly handle errors in the sdk |
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 thought we were going to use throw new Error("")
to differentiate errors from not found status on some functions. How did we handle that?
const buff = String.UTF8.encode(msg) | ||
const dataPtr = changetype<isize>(buff) | ||
const dataLen = msg.length | ||
|
||
return vm.abort(code, dataPtr, dataLen) | ||
vm.abort(code, dataPtr, dataLen) | ||
throw new Error(msg) |
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 is here!
Catch them all
🔗 zboto Link