mirror of
https://github.com/chatmail/core.git
synced 2026-04-26 01:46:34 +03:00
move imap errors into imap module
This commit is contained in:
committed by
Floris Bruynooghe
parent
a7bb249070
commit
f7f61e0f85
@@ -104,7 +104,7 @@ impl JobThread {
|
||||
if let Some(watch_folder) = self.get_watch_folder(context) {
|
||||
let start = std::time::Instant::now();
|
||||
info!(context, "{} started...", prefix);
|
||||
let res = self.imap.fetch(context, &watch_folder);
|
||||
let res = self.imap.fetch(context, &watch_folder).map_err(Into::into);
|
||||
let elapsed = start.elapsed().as_millis();
|
||||
info!(context, "{} done in {:.3} ms.", prefix, elapsed);
|
||||
|
||||
@@ -113,7 +113,7 @@ impl JobThread {
|
||||
Err(Error::WatchFolderNotFound("not-set".to_string()))
|
||||
}
|
||||
}
|
||||
Err(err) => Err(err),
|
||||
Err(err) => Err(crate::error::Error::Other(err.to_string())),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ impl JobThread {
|
||||
info!(context, "{} ended...", prefix);
|
||||
match res {
|
||||
Ok(()) => false,
|
||||
Err(Error::ImapMissesIdle) => true, // we have to do fake_idle
|
||||
Err(crate::imap::Error::IdleAbilityMissing) => true, // we have to do fake_idle
|
||||
Err(err) => {
|
||||
warn!(context, "{} failed: {} -> reconnecting", prefix, err);
|
||||
// something is borked, let's start afresh on the next occassion
|
||||
|
||||
Reference in New Issue
Block a user