diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2013-11-13 17:40:19 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2014-01-29 19:28:29 +0000 |
commit | 657b61379825143b83465c840e1fa70a66d3989f (patch) | |
tree | 24452d489df976d17d883cfc4fa6decf2e6243af | |
parent | b69fcaca8a6c6d60c1106178d1285ef29466c189 (diff) |
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
-rw-r--r-- | src/mcd-storage.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/mcd-storage.c b/src/mcd-storage.c index b3a4bc96..37d6700f 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); } } |