diff --git a/src/rpc/rpc_client.rs b/src/rpc/rpc_client.rs index 3f943dcc2..6119696d2 100644 --- a/src/rpc/rpc_client.rs +++ b/src/rpc/rpc_client.rs @@ -328,10 +328,11 @@ impl RpcHttpClient { ); e })?; - drop(slot); let status = resp.status(); let body = hyper::body::to_bytes(resp.into_body()).await?; + drop(slot); + match rmp_serde::decode::from_read::<_, Result>(body.into_buf())? { Err(e) => Ok(Err(Error::RemoteError(e, status))), Ok(x) => Ok(Ok(x)),