mirror of
https://github.com/chatmail/core.git
synced 2026-04-25 01:16:29 +03:00
Emit an event when SMTP fails (the same is already done for IMAP)
This commit is contained in:
@@ -169,7 +169,11 @@ impl Smtp {
|
||||
.timeout(Some(Duration::from_secs(SMTP_TIMEOUT)));
|
||||
|
||||
let mut trans = client.into_transport();
|
||||
trans.connect().await.map_err(Error::ConnectionFailure)?;
|
||||
|
||||
trans.connect().await.map_err(|err| {
|
||||
emit_event!(context, Event::ErrorNetwork(err.to_string()));
|
||||
Error::ConnectionFailure(err)
|
||||
})?;
|
||||
|
||||
self.transport = Some(trans);
|
||||
self.last_success = Some(Instant::now());
|
||||
|
||||
Reference in New Issue
Block a user