diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2011-08-25 11:13:08 +0100 |
---|---|---|
committer | Will Thompson <will.thompson@collabora.co.uk> | 2011-08-25 11:22:04 +0100 |
commit | 4aad882bcec0a476adbbeab47dee4833c3e053a3 (patch) | |
tree | 591597f7a3f19a5543ce83c2519932792d4c5e7a | |
parent | 7ee4434e8049c170f9ee9766bd9b26913fc6e0cd (diff) |
Include CM name when protocol doesn't exist
This is not really ideal—the real error is that the CM doesn't exist but
due to the current design of this part of MC, it's actually not easy to
determine that.
So at least including the name of the CM might make the error more
obvious.
-rw-r--r-- | src/mcd-account.c | 9 | ||||
-rw-r--r-- | tests/twisted/account-manager/bad-cm.py | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/mcd-account.c b/src/mcd-account.c index 3ee61b33..f36045c2 100644 --- a/src/mcd-account.c +++ b/src/mcd-account.c @@ -2546,6 +2546,12 @@ _mcd_account_set_parameters (McdAccount *account, GHashTable *params, DEBUG ("called"); if (G_UNLIKELY (!priv->manager && !load_manager (account))) { + /* FIXME: this branch is never reached, even if the specified CM + * doesn't actually exist: load_manager essentially always succeeds, + * but of course the TpCM hasn't prepared (or failed, as it will if we + * would like to hit this path) yet. So in practice we hit the next + * block for nonexistant CMs too. + */ g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED, "Manager '%s' not found", priv->manager_name); goto out; @@ -2556,7 +2562,8 @@ _mcd_account_set_parameters (McdAccount *account, GHashTable *params, if (G_UNLIKELY (protocol == NULL)) { g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED, - "Protocol '%s' not found", priv->protocol_name); + "Protocol '%s' not found on CM '%s'", priv->protocol_name, + priv->manager_name); goto out; } diff --git a/tests/twisted/account-manager/bad-cm.py b/tests/twisted/account-manager/bad-cm.py index b00b9138..71ca2433 100644 --- a/tests/twisted/account-manager/bad-cm.py +++ b/tests/twisted/account-manager/bad-cm.py @@ -43,7 +43,7 @@ def test(q, bus, mc): ) e = q.expect('dbus-error', method='CreateAccount') assertEquals(cs.NOT_IMPLEMENTED, e.name) - #assertContains("nonexistent_cm", e.message) + assertContains("nonexistent_cm", e.message) # Create an account with a bad Protocol - it should fail |