Skip to content

Query's errors not handled #1264

Description

@gfusee

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions