mirror of
https://github.com/chatmail/core.git
synced 2026-05-25 01:36:31 +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())
|
let session = tokio::time::timeout(Duration::from_secs(15), handle.done())
|
||||||
.await?
|
.await
|
||||||
.with_context(|| format!("{}: IMAP IDLE protocol timed out", folder_name))?;
|
.with_context(|| format!("{}: IMAP IDLE protocol timed out", folder_name))?
|
||||||
|
.with_context(|| format!("{}: IMAP IDLE failed", folder_name))?;
|
||||||
self.session = Some(Session { inner: session });
|
self.session = Some(Session { inner: session });
|
||||||
} else {
|
} else {
|
||||||
warn!(context, "Attempted to idle without a session");
|
warn!(context, "Attempted to idle without a session");
|
||||||
|
|||||||
Reference in New Issue
Block a user