From 86665944f6867b7142836d226a20ca889fd5e751 Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Thu, 29 Dec 2016 16:53:04 +0100 Subject: [PATCH] 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 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/client/application/secret-mediator.vala b/src/client/application/secret-mediator.vala index b246e6fa..e2e95f82 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.id); 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)