[epiphany/mcatanzaro/#1773: 2/2] password-manager: don't print warnings when operation is cancelled




commit 066186bf34142a1c4fb9f9e095f4a9d504518b24
Author: Michael Catanzaro <mcatanzaro redhat com>
Date:   Fri May 6 16:58:01 2022 -0500

    password-manager: don't print warnings when operation is cancelled

 lib/sync/ephy-password-manager.c | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)
---
diff --git a/lib/sync/ephy-password-manager.c b/lib/sync/ephy-password-manager.c
index 493fd7439..53b89770b 100644
--- a/lib/sync/ephy-password-manager.c
+++ b/lib/sync/ephy-password-manager.c
@@ -383,13 +383,15 @@ secret_password_store_cb (GObject               *source_object,
 
   secret_password_store_finish (result, &error);
   if (error) {
-    g_warning ("Failed to store password record for (%s, %s, %s, %s, %s): %s",
-               origin,
-               ephy_password_record_get_target_origin (data->record),
-               username,
-               ephy_password_record_get_username_field (data->record),
-               ephy_password_record_get_password_field (data->record),
-               error->message);
+    if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
+      g_warning ("Failed to store password record for (%s, %s, %s, %s, %s): %s",
+                 origin,
+                 ephy_password_record_get_target_origin (data->record),
+                 username,
+                 ephy_password_record_get_username_field (data->record),
+                 ephy_password_record_get_password_field (data->record),
+                 error->message);
+    }
     g_error_free (error);
   } else {
     ephy_password_manager_cache_add (data->manager, origin, username);
@@ -578,7 +580,8 @@ retrieve_secret_cb (GObject        *source_object,
 
   value = secret_retrievable_retrieve_secret_finish (retrievable, result, &error);
   if (!value) {
-    g_warning ("Failed to retrieve password: %s", error->message);
+    if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+      g_warning ("Failed to retrieve password: %s", error->message);
     g_error_free (error);
     goto out;
   }
@@ -639,7 +642,8 @@ secret_password_search_cb (GObject        *source_object,
   matches = secret_password_search_finish (result, &error);
   if (!matches) {
     if (error) {
-      g_warning ("Failed to search secrets in password schema: %s", error->message);
+      if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+        g_warning ("Failed to search secrets in password schema: %s", error->message);
       g_error_free (error);
     }
     if (data->callback)


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