Treat connecting differently
This commit is contained in:
parent
9451920c52
commit
b6c58b8a2b
1 changed files with 3 additions and 1 deletions
|
|
@ -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));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue