Refactor error management in API part

This commit is contained in:
Alex Auvolat
2020-11-08 15:04:30 +01:00
parent 54166d2a09
commit a50fa70d45
16 changed files with 193 additions and 131 deletions
+2 -2
View File
@@ -474,7 +474,7 @@ where
todo.push_back(root_ck);
}
} else {
return Err(Error::BadRequest(format!(
return Err(Error::Message(format!(
"Invalid respone to GetRootChecksumRange RPC: {}",
debug_serialize(root_cks_resp)
)));
@@ -530,7 +530,7 @@ where
self.send_items(who, items_to_send).await?;
}
} else {
return Err(Error::BadRequest(format!(
return Err(Error::Message(format!(
"Unexpected response to sync RPC checksums: {}",
debug_serialize(&rpc_resp)
)));