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

Improve Error Handling in IPC CLI #1155

Open
karlem opened this issue Sep 26, 2024 · 3 comments
Open

Improve Error Handling in IPC CLI #1155

karlem opened this issue Sep 26, 2024 · 3 comments

Comments

@karlem
Copy link
Contributor

karlem commented Sep 26, 2024

Some contract calls revert with specific errors. For instance, trying to join a subnet as a collateral validator in federated mode fails with revert MethodNotAllowed(ERR_PERMISSIONED_AND_BOOTSTRAPPED). The CLI should parse these errors and report the reason back to the user.

@cryptoAtwill
Copy link
Contributor

We've had this discussion before. The issue is the ethers-rs somehow does not expose the revert error to ipc-cli, from the tests we did before.

@karlem
Copy link
Contributor Author

karlem commented Sep 27, 2024

@cryptoAtwill I can have a look.

@karlem
Copy link
Contributor Author

karlem commented Oct 2, 2024

The issue is that the Calibration net does not return the revert data in the JSON RPC response. Not in the ethers-rs library. Though the error is inside the message field in the response and can be parsed. Suggested solution:

  1. Look at what ethers-rs does internally to turn the value in "data" to a human readable error, and see if the same "interpretation" API is available publicly. Then we could handle this case by extracting the error data from the message string, and calling that API.
  2. See if you can attach a middleware to intercept the response and massage it into what ethers expects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

2 participants