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

Query's errors not handled #1264

Open
gfusee opened this issue Nov 8, 2023 · 0 comments
Open

Query's errors not handled #1264

gfusee opened this issue Nov 8, 2023 · 0 comments

Comments

@gfusee
Copy link
Contributor

gfusee commented Nov 8, 2023

When a query is a success from the HTTP's point of view (code 200), but a failure regarding the smart contract (code != 0), the sdk panics. This is not a wanted behavior since we cannot handle the errors easily, the only way to do so is by unwinding the stack which is a bad practice.

This error happens because the CommunicationProxy's execute_vmquery method try to parse the result to a ResponseVmValue, regardless if the query is a success or not.

To reproduce:

Query any smart contract with a random function to have the "invalid function" error

(I will likely do a PR soon to fix this)

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

No branches or pull requests

1 participant