Skip to content

Commit

Permalink
refactor(rpc-server): Make shadow_data_consistency check handle TIMEO…
Browse files Browse the repository at this point in the history
…UT_ERROR as NearRpcCallError (#101)
  • Loading branch information
khorolets authored Aug 15, 2023
1 parent d536fbf commit 38edc73
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion rpc-server/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,15 @@ where
Err(err) => {
if let Some(e) = err.handler_error() {
match serde_json::to_value(&e) {
Ok(near_rpc_response_json) => (near_rpc_response_json, false),
Ok(near_rpc_response_json) => {
if near_rpc_response_json["name"] == "TIMEOUT_ERROR" {
return Err(ShadowDataConsistencyError::NearRpcCallError(format!(
"{:?}",
err
)));
}
(near_rpc_response_json, false)
}
Err(err) => {
return Err(ShadowDataConsistencyError::NearRpcResponseParseError(err));
}
Expand Down

0 comments on commit 38edc73

Please sign in to comment.