diff options
author | Dan Winship <danw@gnome.org> | 2014-10-15 15:27:25 -0400 |
---|---|---|
committer | Dan Winship <danw@gnome.org> | 2014-10-22 08:29:09 -0400 |
commit | 86331d9ef49716a4bd2a7790289b5665eed84dd1 (patch) | |
tree | 59001bb16bc7c3d3c62a173f4c91cffa908095f3 /libnm-core | |
parent | d13bfe3cf8f2f8714f12949a2dfdc0bbd16a59e2 (diff) | |
download | NetworkManager-86331d9ef49716a4bd2a7790289b5665eed84dd1.tar.gz |
libnm-core, settings: move NMAgentManagerError to nm-errors
Move the definition of NMAgentManagerError to nm-errors, register it
with D-Bus, and verify in the tests that it maps correctly.
Diffstat (limited to 'libnm-core')
-rw-r--r-- | libnm-core/nm-errors.c | 4 | ||||
-rw-r--r-- | libnm-core/nm-errors.h | 32 |
2 files changed, 36 insertions, 0 deletions
diff --git a/libnm-core/nm-errors.c b/libnm-core/nm-errors.c index b51cf4f9ea..0e45f50ce8 100644 --- a/libnm-core/nm-errors.c +++ b/libnm-core/nm-errors.c @@ -26,6 +26,7 @@ #include "nm-dbus-interface.h" #include "nm-core-internal.h" +G_DEFINE_QUARK (nm-agent-manager-error-quark, nm_agent_manager_error) G_DEFINE_QUARK (nm-connection-error-quark, nm_connection_error) G_DEFINE_QUARK (nm-crypto-error-quark, nm_crypto_error) G_DEFINE_QUARK (nm-device-error-quark, nm_device_error) @@ -57,6 +58,9 @@ register_error_domain (GQuark domain, void _nm_dbus_errors_init (void) { + register_error_domain (NM_AGENT_MANAGER_ERROR, + NM_DBUS_INTERFACE_AGENT_MANAGER, + NM_TYPE_AGENT_MANAGER_ERROR); register_error_domain (NM_CONNECTION_ERROR, NM_DBUS_INTERFACE_SETTINGS_CONNECTION, NM_TYPE_CONNECTION_ERROR); diff --git a/libnm-core/nm-errors.h b/libnm-core/nm-errors.h index 26afd4386d..62434dfb75 100644 --- a/libnm-core/nm-errors.h +++ b/libnm-core/nm-errors.h @@ -21,6 +21,38 @@ #define __NM_ERRORS_H__ /** + * NMAgentManagerError: + * @NM_AGENT_MANAGER_ERROR_FAILED: unknown or unspecified error + * @NM_AGENT_MANAGER_ERROR_PERMISSION_DENIED: The caller does not have permission + * to register a secret agent, or is trying to register the same secret agent + * twice. + * @NM_AGENT_MANAGER_ERROR_INVALID_IDENTIFIER: The identifier is not a valid + * secret agent identifier. + * @NM_AGENT_MANAGER_ERROR_NOT_REGISTERED: The caller tried to unregister an agent + * that was not registered. + * @NM_AGENT_MANAGER_ERROR_NO_SECRETS: No secret agent returned secrets for this + * request + * @NM_AGENT_MANAGER_ERROR_USER_CANCELED: The user canceled the secrets request. + * + * Errors returned from the secret-agent manager. + * + * These errors may be returned from operations that could cause secrets to be + * requested (such as nm_client_activate_connection()), and correspond to D-Bus + * errors in the "org.freedesktop.NetworkManager.AgentManager" namespace. + */ +typedef enum { + NM_AGENT_MANAGER_ERROR_FAILED = 0, /*< nick=Failed >*/ + NM_AGENT_MANAGER_ERROR_PERMISSION_DENIED, /*< nick=PermissionDenied >*/ + NM_AGENT_MANAGER_ERROR_INVALID_IDENTIFIER, /*< nick=InvalidIdentifier >*/ + NM_AGENT_MANAGER_ERROR_NOT_REGISTERED, /*< nick=NotRegistered >*/ + NM_AGENT_MANAGER_ERROR_NO_SECRETS, /*< nick=NoSecrets >*/ + NM_AGENT_MANAGER_ERROR_USER_CANCELED, /*< nick=UserCanceled >*/ +} NMAgentManagerError; + +GQuark nm_agent_manager_error_quark (void); +#define NM_AGENT_MANAGER_ERROR (nm_agent_manager_error_quark ()) + +/** * NMConnectionError: * @NM_CONNECTION_ERROR_FAILED: unknown or unclassified error * @NM_CONNECTION_ERROR_SETTING_NOT_FOUND: the #NMConnection object |