mirror of
https://github.com/chatmail/core.git
synced 2026-04-29 11:26:29 +03:00
Add contexts to both the timeout and actual IDLE error
Note that `IMAP IDLE protocol timed out` was previously added to the wrong error: not the timeout error (first `?`) but actual error happened during IDLE, such as a network error.
This commit is contained in:
@@ -97,8 +97,9 @@ impl Imap {
|
||||
}
|
||||
|
||||
let session = tokio::time::timeout(Duration::from_secs(15), handle.done())
|
||||
.await?
|
||||
.with_context(|| format!("{}: IMAP IDLE protocol timed out", folder_name))?;
|
||||
.await
|
||||
.with_context(|| format!("{}: IMAP IDLE protocol timed out", folder_name))?
|
||||
.with_context(|| format!("{}: IMAP IDLE failed", folder_name))?;
|
||||
self.session = Some(Session { inner: session });
|
||||
} else {
|
||||
warn!(context, "Attempted to idle without a session");
|
||||
|
||||
Reference in New Issue
Block a user