Fix room disconnection problems when creating room and sharing project

This commit is contained in:
Antonio Scandurra 2022-10-07 14:39:11 +02:00
parent 4aaf3df8c7
commit 386de03f46
5 changed files with 81 additions and 61 deletions

View file

@ -394,7 +394,11 @@ impl Peer {
send?;
let (response, _barrier) = rx.await.map_err(|_| anyhow!("connection was closed"))?;
if let Some(proto::envelope::Payload::Error(error)) = &response.payload {
Err(anyhow!("RPC request failed - {}", error.message))
Err(anyhow!(
"RPC request {} failed - {}",
T::NAME,
error.message
))
} else {
T::Response::from_envelope(response)
.ok_or_else(|| anyhow!("received response of the wrong type"))