-
Notifications
You must be signed in to change notification settings - Fork 11
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
refactor: return an error in case response deserialization fails #377
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #377 +/- ##
=======================================
Coverage ? 80.70%
=======================================
Files ? 35
Lines ? 1622
Branches ? 1622
=======================================
Hits ? 1309
Misses ? 246
Partials ? 67 ☔ View full report in Codecov by Sentry. |
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.
Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @uriel-starkware)
crates/mempool_infra/src/component_client.rs
line 125 at r1 (raw file):
#[error("Got an unexpected response type.")] UnexpectedResponse, #[error("Could not deserialize response from server.")]
Please change to "server response"
Code quote:
response from server
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.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @uriel-starkware)
crates/mempool_infra/src/component_client.rs
line 96 at r1 (raw file):
.await .map_err(ClientError::ResponseParsingFailure)?; deserialize(&body_bytes).map_err(|_e| ClientError::ResponseDeserializationFailure)
Can the error _e
be in ClientError::ResponseDeserializationFailure
?
Code quote:
.map_err(|_e| ClientError::ResponseDeserializationFailure)
0fa3cf6
to
1b3d8d8
Compare
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.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @Itay-Tsabary-Starkware)
crates/mempool_infra/src/component_client.rs
line 96 at r1 (raw file):
Previously, Itay-Tsabary-Starkware wrote…
Can the error
_e
be inClientError::ResponseDeserializationFailure
?
I can convert it to string, is that fine?
crates/mempool_infra/src/component_client.rs
line 125 at r1 (raw file):
Previously, Itay-Tsabary-Starkware wrote…
Please change to "server response"
ok
1b3d8d8
to
a5c6715
Compare
a5c6715
to
d619ad4
Compare
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.
Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @uriel-starkware)
This change is