GNOME Bugzilla – Bug 687503
Improve error message »Failed to refresh folders«
Last modified: 2012-12-03 17:33:29 UTC
Even with Milan’s fix in version 3.6.0 commit 6b255c9309d642d59c14e809ab9a7144d93409f3 Author: Milan Crha <mcrha@redhat.com> Date: Fri Aug 17 13:58:57 2012 +0200 Include folder uri in "Failed to refresh folder" runtime warning the current error message printed to the terminal (evolution:11858): evolution-mail-WARNING **: Failed to refresh folder: folder://1344563600.xxxx.32%40myhostname/Drafts: Server-Verbindung unerwartet getrennt:I/O operation timed out is not very useful to the user. Changing it to something like evolution-mail-WARNING **: Failed to refresh folder Drafts (joey@mail.example.net): Server-Verbindung unerwartet getrennt:I/O operation is preferable.
Created attachment 227963 [details] [review] [PATCH] mail/mail-send-recv.c: Elaborate error message when refreshing folders (Closes: 687503) Here is a draft patch. More or less copied from Evolution Data Server. camel/providers/imap/camel-imap-command.c 1. I need to improve the commit message. 2. Also I do not know which of the variables need to be freed. 3. I think, the folder information can also be given in the error string returned by Evolution Data Server. Unfortunately for some reason, I might have edited the wrong part and turned to Evolution then. So leave Milan change as is and let the error string contain the user and server information.
Created attachment 228023 [details] [review] [PATCH v2] Bug 687503 – Add user, server and folder to error message when refreshing a folder fails v2: Update changelog 1. If the local folder ID(?) is useful for the user, it should be left in there. 2. What variable need to be freed?
OK, once again, this is just a console message, regular users will not notice it. Messages on console are meant as developer hints, and with certain circumstances any g_warning can lead to application's abort. For the patch itself: a) do not read all the variables always, but only when needed, thus just before the g_warning() call - you added unnecessary overhead there b) use CamelStore *store = camel_folder_get_parent_store (folder); const gchar *account_name = camel_service_get_display_name ( CAMEL_SERVICE (store)); This way you get the same name as is shown in the folder tree and there is no extra memory allocation involved.
Created attachment 230544 [details] [review] eds patch for evolution-data-server; I updated your patch. I realized I overlooked that the CamelFolder is unreffed before this g_Warning() too, thus I changed that too. With this, the message looks either like: Failed to refresh folder 'accountName: Inbox/...': error message or, if the folder is unavailable: Failed to refresh folder 'folder://uis/Inbox/...': error message where the 'accountName' is the account's name, as shown in the left folder tree.
Created attachment 230545 [details] [review] evo patch for evolution; (of course, I'm sorry for my mistake) I updated your patch. I realized I overlooked that the CamelFolder is unreffed before this g_Warning() too, thus I changed that too. With this, the message looks either like: Failed to refresh folder 'accountName: Inbox/...': error message or, if the folder is unavailable: Failed to refresh folder 'folder://uis/Inbox/...': error message where the 'accountName' is the account's name, as shown in the left folder tree.
Created commit 01a3fd2 in evo master (3.7.3+)