[geary/geary-0.11] Don't abort the application if password could not be saved in the secrets manager. Bug 776139



commit 5da03880da47b316aa4256a89981f34e328bcd9f
Author: Gautier Pelloux-Prayer <gautier+git damsy net>
Date:   Thu Dec 29 16:53:04 2016 +0100

    Don't abort the application if password could not be saved in the secrets manager. Bug 776139

 src/client/application/secret-mediator.vala |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/src/client/application/secret-mediator.vala b/src/client/application/secret-mediator.vala
index 1d777cd..75e64f1 100644
--- a/src/client/application/secret-mediator.vala
+++ b/src/client/application/secret-mediator.vala
@@ -83,12 +83,14 @@ public class SecretMediator : Geary.CredentialsMediator, Object {
         Cancellable? cancellable = null) throws Error {
         string key_name = get_key_name(service, account_information.email);
         Geary.Credentials credentials = get_credentials(service, account_information);
-        
-        bool result = yield Secret.password_store(Secret.SCHEMA_COMPAT_NETWORK,
-            null, key_name, credentials.pass, cancellable, "user", key_name);
-        if (!result)
-            debug("Unable to store password for \"%s\" in libsecret keyring", key_name);
+        try {
+            yield Secret.password_store(Secret.SCHEMA_COMPAT_NETWORK,
+                null, key_name, credentials.pass, cancellable, "user", key_name);
+        } catch (Error e) {
+            debug("Unable to store password for \"%s\" in libsecret keyring: %s", key_name, e.message);
+        }
     }
+
     
     public virtual async void clear_password_async(
         Geary.Service service, Geary.AccountInformation account_information, Cancellable? cancellable = null)


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