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

catch syscall errors #14

Merged
merged 3 commits into from
Jul 5, 2022
Merged

catch syscall errors #14

merged 3 commits into from
Jul 5, 2022

Conversation

rllola
Copy link
Contributor

@rllola rllola commented Jun 27, 2022

Catch them all

🔗 zboto Link

Copy link
Member

@emmanuelm41 emmanuelm41 left a 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?

@rllola
Copy link
Contributor Author

rllola commented Jun 27, 2022

Yeah that would make sense to throw errors

@rllola rllola marked this pull request as ready for review July 1, 2022 10:49
@rllola rllola requested a review from emmanuelm41 July 1, 2022 10:49
@rllola
Copy link
Contributor Author

rllola commented Jul 1, 2022

We should now properly handle errors in the sdk

Copy link
Member

@emmanuelm41 emmanuelm41 left a 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)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is here!

@rllola rllola merged commit 5f470a3 into master Jul 5, 2022
@rllola rllola deleted the fix/verify-error branch July 5, 2022 13:45
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.

2 participants