[evolution-data-server/gnome-3-26] Ignore "timed out" error from goa_account_call_ensure_credentials_sync()
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/gnome-3-26] Ignore "timed out" error from goa_account_call_ensure_credentials_sync()
- Date: Fri, 15 Sep 2017 12:02:08 +0000 (UTC)
commit 21214416c489c71477785527321ca35d7511b881
Author: Milan Crha <mcrha redhat com>
Date: Fri Sep 15 13:39:28 2017 +0200
Ignore "timed out" error from goa_account_call_ensure_credentials_sync()
It can be that the server is very slow, then the timeout on the D-Bus
call can be reached sooner than the server responds, thus let's
ignore the error and continue to get the stored password from GOA.
.../gnome-online-accounts/e-goa-password-based.c | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/src/modules/gnome-online-accounts/e-goa-password-based.c
b/src/modules/gnome-online-accounts/e-goa-password-based.c
index 19d23cf..685b602 100644
--- a/src/modules/gnome-online-accounts/e-goa-password-based.c
+++ b/src/modules/gnome-online-accounts/e-goa-password-based.c
@@ -186,6 +186,7 @@ e_goa_password_based_lookup_sync (ESourceCredentialsProviderImpl *provider_impl,
gboolean use_imap_password;
gboolean use_smtp_password;
gboolean success = FALSE;
+ GError *local_error = NULL;
g_return_val_if_fail (E_IS_GOA_PASSWORD_BASED (provider_impl), FALSE);
g_return_val_if_fail (E_IS_SOURCE (source), FALSE);
@@ -222,12 +223,16 @@ e_goa_password_based_lookup_sync (ESourceCredentialsProviderImpl *provider_impl,
goto exit;
}
- success = goa_account_call_ensure_credentials_sync (
- goa_account, NULL, cancellable, error);
+ success = goa_account_call_ensure_credentials_sync (goa_account, NULL, cancellable, &local_error);
if (!success) {
- if (error && *error)
- g_dbus_error_strip_remote_error (*error);
- goto exit;
+ if (g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_TIMED_OUT)) {
+ g_clear_error (&local_error);
+ } else if (local_error) {
+ g_dbus_error_strip_remote_error (local_error);
+ g_propagate_error (error, local_error);
+
+ goto exit;
+ }
}
use_imap_password = e_source_has_extension (source, E_SOURCE_EXTENSION_MAIL_ACCOUNT);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]