Improve error handling when the user mixes up gossip (8001) and RPC (8899) ports (#7158)
automerge
This commit is contained in:
@ -56,6 +56,10 @@ impl GenericRpcClientRequest for RpcClientRequest {
|
||||
.send()
|
||||
{
|
||||
Ok(mut response) => {
|
||||
if !response.status().is_success() {
|
||||
return Err(response.error_for_status().unwrap_err().into());
|
||||
}
|
||||
|
||||
let json: serde_json::Value = serde_json::from_str(&response.text()?)?;
|
||||
if json["error"].is_object() {
|
||||
return Err(RpcError::RpcRequestError(format!(
|
||||
|
Reference in New Issue
Block a user