[geary/wip/794700-lazy-load-conversations: 17/19] Fix FetchEmail throwing wrong error for LOCAL_ONLY with incomplete email
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/794700-lazy-load-conversations: 17/19] Fix FetchEmail throwing wrong error for LOCAL_ONLY with incomplete email
- Date: Mon, 21 Jan 2019 00:42:58 +0000 (UTC)
commit 8d86368dc22493c8fbcfb2760515043d4b12b12c
Author: Michael Gratton <mike vee net>
Date: Mon Jan 21 10:27:22 2019 +1030
Fix FetchEmail throwing wrong error for LOCAL_ONLY with incomplete email
.../imap-engine/replay-ops/imap-engine-fetch-email.vala | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/src/engine/imap-engine/replay-ops/imap-engine-fetch-email.vala
b/src/engine/imap-engine/replay-ops/imap-engine-fetch-email.vala
index 5a5039bc..fcbc3012 100644
--- a/src/engine/imap-engine/replay-ops/imap-engine-fetch-email.vala
+++ b/src/engine/imap-engine/replay-ops/imap-engine-fetch-email.vala
@@ -61,13 +61,17 @@ private class Geary.ImapEngine.FetchEmail : Geary.ImapEngine.SendReplayOperation
// If returned in full, done
if (email != null && email.fields.fulfills(required_fields))
return ReplayOperation.Status.COMPLETED;
-
- // If local only and not found fully in local store, throw NOT_FOUND
+
+ // If local only, ensure the email has all required fields
if (flags.is_all_set(Folder.ListFlags.LOCAL_ONLY)) {
- throw new EngineError.NOT_FOUND("Email %s with fields %Xh not found in %s", id.to_string(),
- required_fields, to_string());
+ throw new EngineError.INCOMPLETE_MESSAGE(
+ "Email %s with fields %Xh not found in %s",
+ id.to_string(),
+ required_fields,
+ to_string()
+ );
}
-
+
// only fetch what's missing
if (email != null)
remaining_fields = required_fields.clear(email.fields);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]