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

Handling provider legit errors caused by revert #137

Open
pvgo80 opened this issue Apr 21, 2023 · 0 comments
Open

Handling provider legit errors caused by revert #137

pvgo80 opened this issue Apr 21, 2023 · 0 comments
Labels
backend bug Something isn't working

Comments

@pvgo80
Copy link

pvgo80 commented Apr 21, 2023

Calls to the provider (e.g. eth_estimategas, eth_call) may revert, leading to legitimate errors that could be handy in the wallet.

The application panicked (crashed).
Message:  called `Result::unwrap()` on an `Err` value: JsonRpcClientError(JsonRpcError(JsonRpcError { code: 3, message: "execution reverted: Input must be greater than or equal to 10", data: Some(String("0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000029496e707574206d7573742062652067726561746572207468616e206f7220657175616c20746f2031300000000000000000000000000000000000000000000000")) }))
Location: tauri/src/rpc.rs:69

In the spirit of a wallet for devs, this could be handy to test.

Currently bypassing this limitation by ignoring code 3 errors (if provider_err.to_string().contains("code: 3, message:")) but this could be an opportunity to model the errors and trigger some action (force send, etc).

@pvgo80 pvgo80 added bug Something isn't working backend labels Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant