From 2b8923931ed64839c446ebbb1789263c6f1bec84 Mon Sep 17 00:00:00 2001 From: link2xt Date: Tue, 10 Jan 2023 00:00:23 +0000 Subject: [PATCH] Add more context to IMAP errors --- src/imap.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/imap.rs b/src/imap.rs index 84871cb89..94d4223d2 100644 --- a/src/imap.rs +++ b/src/imap.rs @@ -698,9 +698,11 @@ impl Imap { let old_uid_next = get_uid_next(context, folder).await?; let msgs = if fetch_existing_msgs { - self.prefetch_existing_msgs().await? + self.prefetch_existing_msgs() + .await + .context("prefetch_existing_msgs")? } else { - self.prefetch(old_uid_next).await? + self.prefetch(old_uid_next).await.context("prefetch")? }; let read_cnt = msgs.len(); @@ -763,7 +765,7 @@ impl Imap { fetch_response.flags(), show_emails, ) - .await? + .await.context("prefetch_should_download")? { match download_limit { Some(download_limit) => uids_fetch.push(( @@ -799,7 +801,8 @@ impl Imap { fetch_partially, fetch_existing_msgs, ) - .await?; + .await + .context("fetch_many_msgs")?; received_msgs.extend(received_msgs_in_batch); largest_uid_fetched = max( largest_uid_fetched,