Handle robot disconnects more cleanly
parent
6129060319
commit
cf64eafcb5
|
@ -92,7 +92,20 @@ impl RobotManager {
|
|||
return Err(Error::ConnectionClosed(*id));
|
||||
}
|
||||
|
||||
let resp = recv_raas_msg(&mut connector.stream).await?;
|
||||
let ret = recv_raas_msg(&mut connector.stream).await;
|
||||
|
||||
let resp = match ret {
|
||||
Ok(r) => r,
|
||||
Err(err) => {
|
||||
error!(
|
||||
"Got '{}' receiving message to Robot Connector id={}, closing connection",
|
||||
err, id
|
||||
);
|
||||
|
||||
return Err(Error::ConnectionClosed(*id));
|
||||
}
|
||||
};
|
||||
|
||||
info!("Got response from id={}", id);
|
||||
self.send_resp(resp).await?;
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue