-
Notifications
You must be signed in to change notification settings - Fork 255
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
Rpc Error handling #724
Comments
Currently using a fork that makes the error concrete again. Obviously this will be a problem for non-jsonrpc transport implementations though. Ideally, the |
The current approach is that you have to downcast the or am I misunderstanding something? |
Yeah; It was so nice to be able to remove a generic param from the error type (which infests and complicates everything else) that I'd be somewhat reluctant to put it back! |
Thanks, I wasn't aware of the |
#634 generalized the code over rpc implementations. This PR changed the
subxt::Error::Rpc
error to a generalized one. First to a string, later to adyn std::Error
:subxt/subxt/src/error.rs
Lines 111 to 118 in 15ffbb6
The problem is that this removes our ability to react to different rpc errors. For some errors we can recover, such as the
POOL_TOO_LOW_PRIORITY
error that we get when two connections use the same nonce at the same time. Other errors are unrecoverable, such asJsonRpseeError::RestartNeeded
. Would it be possible to makesubxt::Error
generic over the rpc error type so that we can use proper pattern matching in our client?The text was updated successfully, but these errors were encountered: