Treat connecting differently

This commit is contained in:
Joscha 2022-03-03 00:34:01 +01:00
parent 9451920c52
commit b6c58b8a2b

View file

@ -16,6 +16,8 @@ use crate::replies::{self, Replies};
// TODO Split into "interacting" and "maintenance" parts? // TODO Split into "interacting" and "maintenance" parts?
#[derive(Debug, thiserror::Error)] #[derive(Debug, thiserror::Error)]
pub enum Error { pub enum Error {
#[error("{0}")]
CouldNotConnect(conn::Error),
#[error("{0}")] #[error("{0}")]
Conn(#[from] conn::Error), Conn(#[from] conn::Error),
#[error("{0}")] #[error("{0}")]
@ -233,7 +235,7 @@ impl CoveConnMt {
Err(e) => { Err(e) => {
*self.conn.lock().await.state_mut() = State::Stopped; *self.conn.lock().await.state_mut() = State::Stopped;
self.ev_tx.send(Event::StateChanged); self.ev_tx.send(Event::StateChanged);
return Err(Error::Conn(e)); return Err(Error::CouldNotConnect(e));
} }
}; };