[Pkg-telepathy-commits] [telepathy-mission-control-6] 179/280: McdStorage: adjust IdentifyAccount error behaviour

Simon McVittie smcv at debian.org
Thu Mar 27 20:07:21 UTC 2014


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch debian
in repository telepathy-mission-control-6.

commit 657b61379825143b83465c840e1fa70a66d3989f
Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Wed Nov 13 17:40:19 2013 +0000

    McdStorage: adjust IdentifyAccount error behaviour
    
    We were ignoring failures if they were NotImplemented or ServiceUnknown,
    but thinking about it more, we should probably ignore "most" errors
    here: the only errors that should abort the account-creation attempt
    are those that indicate that the intended parameters are unusable,
    namely InvalidArgument and InvalidHandle (in its secondary role as
    "invalid identifier-that-corresponds-to-a-handle").
    
    Also add more debug messages here.
    
    Bug: https://bugs.freedesktop.org/show_bug.cgi?id=27727
---
 src/mcd-storage.c | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/src/mcd-storage.c b/src/mcd-storage.c
index b3a4bc9..37d6700 100644
--- a/src/mcd-storage.c
+++ b/src/mcd-storage.c
@@ -469,17 +469,26 @@ identify_account_cb (TpProxy *proxy,
 {
   if (error == NULL)
     {
+      DEBUG ("identified account: %s", identification);
       g_task_return_pointer (task, g_strdup (identification), g_free);
     }
-  else if (g_error_matches (error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED) ||
-      g_error_matches (error, DBUS_GERROR, DBUS_GERROR_SERVICE_UNKNOWN))
+  else if (g_error_matches (error, TP_ERROR, TP_ERROR_INVALID_HANDLE) ||
+      g_error_matches (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT))
     {
-      g_task_return_pointer (task, g_strdup (g_task_get_task_data (task)),
-          g_free);
+      /* The connection manager didn't like our account parameters.
+       * Give up now. */
+      DEBUG ("failed to identify account: %s #%d: %s",
+          g_quark_to_string (error->domain), error->code, error->message);
+      g_task_return_error (task, g_error_copy (error));
     }
   else
     {
-      g_task_return_error (task, g_error_copy (error));
+      /* We weren't able to identify the account, but carry on and hope
+       * for the best... */
+      DEBUG ("ignoring failure to identify account: %s #%d: %s",
+          g_quark_to_string (error->domain), error->code, error->message);
+      g_task_return_pointer (task, g_strdup (g_task_get_task_data (task)),
+          g_free);
     }
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-telepathy/telepathy-mission-control-6.git



More information about the Pkg-telepathy-commits mailing list