-
Notifications
You must be signed in to change notification settings - Fork 28
Integrate JSON-RPC method errors #644
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
base: dev
Are you sure you want to change the base?
Conversation
| map_err::Mapper: map_err::MapRpcError<MethodError>, | ||
| { | ||
| let id = self.id_counter.fetch_add(1, Ordering::SeqCst); | ||
| #[derive(Deserialize)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it intentional for this to be defined within the send_request method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i see, it's generic over R
|
|
||
| let max_attempts = 5; | ||
| let mut attempts = 0; | ||
| loop { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like these changes are dropping the retry feature. Is it intentional?
| T: std::fmt::Debug + Serialize, | ||
| R: std::fmt::Debug + for<'de> Deserialize<'de> + ResponseToError, | ||
| >( | ||
| async fn send_request<T, R, MethodError>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is looking large enough that i would recommend chopping it down into smaller functions, to keep it readable and testable.
| code = err.code, | ||
| kind = ?err.kind(), | ||
| message = %err.message, | ||
| params = tracing::field::debug(¶ms), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we clear on the sensitivity of these values? can we freely log them in any case?
| /// Json RPSee Error type. | ||
| #[derive(Serialize, Deserialize, Debug)] | ||
| #[derive(Serialize, Deserialize, Debug, Clone)] | ||
| pub struct RpcError { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would put all these error types on jsonrpsee/connector.rs
Motivation
Solution
Tests
Specifications & References
Follow-up Work
PR Checklist