[geary] Update hidden ConversationMonitor error debug logging to warnings



commit d320d33b8457d1741f25ecdb4546c3118112a46e
Author: Michael Gratton <mike vee net>
Date:   Fri Feb 8 10:46:21 2019 +1100

    Update hidden ConversationMonitor error debug logging to warnings
    
    This will make them a bit more visible if they actually happen.

 src/engine/app/app-conversation-monitor.vala | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)
---
diff --git a/src/engine/app/app-conversation-monitor.vala b/src/engine/app/app-conversation-monitor.vala
index 513bed78..c9907688 100644
--- a/src/engine/app/app-conversation-monitor.vala
+++ b/src/engine/app/app-conversation-monitor.vala
@@ -307,7 +307,9 @@ public class Geary.App.ConversationMonitor : BaseObject {
             try {
                 yield stop_monitoring_internal(false, null);
             } catch (Error stop_error) {
-                debug("Error cleaning up after folder open error: %s", err.message);
+                warning(
+                    "Error cleaning up after folder open error: %s", err.message
+                );
             }
             throw err;
         }
@@ -516,14 +518,13 @@ public class Geary.App.ConversationMonitor : BaseObject {
             yield folder.close_async(null);
             opened = false;
         } catch (Error err) {
-            debug("Error loading external emails: %s", err.message);
             if (opened) {
                 // Always try to close the opened folder
                 try {
                     yield folder.close_async(null);
                 } catch (Error close_err) {
-                    debug("Error closing folder %s: %s",
-                          folder.to_string(), close_err.message);
+                    warning("Error closing folder %s: %s",
+                            folder.to_string(), close_err.message);
                 }
             }
             throw err;
@@ -658,8 +659,8 @@ public class Geary.App.ConversationMonitor : BaseObject {
                 // Always close the folder to prevent open leaks
                 closing = yield this.base_folder.close_async(null);
             } catch (Error err) {
-                debug("Unable to close monitored folder %s: %s",
-                      this.base_folder.to_string(), err.message);
+                warning("Unable to close monitored folder %s: %s",
+                        this.base_folder.to_string(), err.message);
                 close_err = err;
             }
         }
@@ -729,10 +730,11 @@ public class Geary.App.ConversationMonitor : BaseObject {
                     out added, out appended, out removed_due_to_merge
                 );
             }
-        } catch (Error err) {
-            debug("Unable to add emails to conversation: %s", err.message);
-
-            // fall-through
+        } catch (GLib.IOError.CANCELLED err) {
+            // All good
+        } catch (GLib.Error err) {
+            warning("Unable to add emails to conversation: %s", err.message);
+            // Fall-through anyway
         }
 
         if (removed_due_to_merge != null && removed_due_to_merge.size > 0) {
@@ -921,7 +923,9 @@ public class Geary.App.ConversationMonitor : BaseObject {
     }
 
     private void on_operation_error(ConversationOperation op, Error err) {
-        debug("Error executing %s: %s", op.get_type().name(), err.message);
+        if (!(err is GLib.IOError.CANCELLED)) {
+            warning("Error executing %s: %s", op.get_type().name(), err.message);
+        }
         notify_scan_error(err);
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]