-
Notifications
You must be signed in to change notification settings - Fork 118
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
[x/programs] pass error messages from host functions #666
Labels
Comments
Seems like this is linked with #595? |
See specific comment from the above PR here |
This issue has become stale because it has been open 60 days with no activity. Adding the |
Closing this in favour of #595. Host functions (with the exception of external calls) should not return |
github-project-automation
bot
moved this from Backlog 🗄️
to Done ✅
in Platform Engineering Group
Jun 10, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently if our host function throws an error we propagate it up the runtime and stop executing the program.
Defining a common
hostResponse
in thehost
andguest
would provide a more descriptive error handling framework. A potential struct like this would give us more programability and allow us to better handle different responses in the guest.the host function would convert a
hostResponse
to asmartPtr
and then return as*types.Val
in order to match the required function signature. Or it can stop program execution by throwing anerror
.For example, the
getFn
host function returns -1 if it cannot find a key in its db. It also returns a -1 if it cannot grab bytes from memory(a more serious error). These errors are not descriptive. Even with the new refactor of #660, some errors should still be passed to the host while others can stop the runtime.The text was updated successfully, but these errors were encountered: