[geary] Improved debugging and appropriate Error in Imap.Account
- From: Jim Nelson <jnelson src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary] Improved debugging and appropriate Error in Imap.Account
- Date: Tue, 2 Sep 2014 04:57:32 +0000 (UTC)
commit b8910bf57270e0a5b79ffd8502f73c82ec9bfd8a
Author: Jim Nelson <jim yorba org>
Date: Mon Sep 1 21:53:50 2014 -0700
Improved debugging and appropriate Error in Imap.Account
src/engine/imap/api/imap-account.vala | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/engine/imap/api/imap-account.vala b/src/engine/imap/api/imap-account.vala
index 2bff719..9da0272 100644
--- a/src/engine/imap/api/imap-account.vala
+++ b/src/engine/imap/api/imap-account.vala
@@ -316,8 +316,11 @@ private class Geary.Imap.Account : BaseObject {
check_open();
Gee.List<MailboxInformation>? child_info = yield list_children_async(parent, cancellable);
- if (child_info == null || child_info.size == 0)
+ if (child_info == null || child_info.size == 0) {
+ debug("No children found listing %s", (parent != null) ? parent.to_string() : "root");
+
return null;
+ }
Gee.List<Imap.Folder> child_folders = new Gee.ArrayList<Imap.Folder>();
@@ -358,6 +361,7 @@ private class Geary.Imap.Account : BaseObject {
if (response.status != Status.OK) {
message("Unable to get STATUS of %s: %s", mailbox.to_string(), response.to_string());
+ message("STATUS command: %s", cmd.to_string());
continue;
}
@@ -430,8 +434,10 @@ private class Geary.Imap.Account : BaseObject {
Gee.List<MailboxInformation> list_results = new Gee.ArrayList<MailboxInformation>();
StatusResponse response = yield send_command_async(cmd, list_results, null, cancellable);
- if (response.status != Status.OK)
- throw_not_found(parent);
+ if (response.status != Status.OK) {
+ throw new ImapError.SERVER_ERROR("Unable to list children of %s: %s",
+ (parent != null) ? parent.to_string() : "root", response.to_string());
+ }
// See note at ListCommand about some servers returning the parent's name alongside their
// children ... this filters this out
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]