diff --git a/libnm-core/nm-connection.c b/libnm-core/nm-connection.c index 142fee4cd0..23e9f2159c 100644 --- a/libnm-core/nm-connection.c +++ b/libnm-core/nm-connection.c @@ -1012,8 +1012,8 @@ nm_connection_update_secrets (NMConnection *connection, if (!full_connection) { g_set_error_literal (error, NM_CONNECTION_ERROR, - NM_CONNECTION_ERROR_SETTING_NOT_FOUND, - key); + NM_CONNECTION_ERROR_INVALID_SETTING, + _("Update secrets expects a full connection, instead only a setting is provided.")); return FALSE; } diff --git a/libnm-core/tests/test-secrets.c b/libnm-core/tests/test-secrets.c index 738441ad47..d728223b39 100644 --- a/libnm-core/tests/test-secrets.c +++ b/libnm-core/tests/test-secrets.c @@ -716,7 +716,7 @@ test_update_secrets_null_setting_name_with_setting_hash (void) secrets = build_wep_secrets (wepkey); success = nm_connection_update_secrets (connection, NULL, secrets, &error); - g_assert_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_SETTING_NOT_FOUND); + g_assert_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_SETTING); g_assert (!success); g_variant_unref (secrets);