mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-29 16:10:11 +01:00
core: provide useful error messages to main() on Manager creation failure
This commit is contained in:
parent
e62b212be3
commit
016dbcc99e
2 changed files with 5 additions and 2 deletions
|
|
@ -4505,7 +4505,8 @@ nm_manager_new (NMSettings *settings,
|
|||
|
||||
bus = nm_dbus_manager_get_connection (priv->dbus_mgr);
|
||||
if (!bus) {
|
||||
nm_log_err (LOGD_CORE, "Failed to initialize D-Bus connection");
|
||||
g_set_error_literal (error, NM_MANAGER_ERROR, NM_MANAGER_ERROR_INTERNAL,
|
||||
"Failed to initialize D-Bus connection");
|
||||
g_object_unref (singleton);
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -4528,7 +4529,8 @@ nm_manager_new (NMSettings *settings,
|
|||
G_CALLBACK (connectivity_changed), singleton);
|
||||
|
||||
if (!dbus_connection_add_filter (dbus_connection, prop_filter, singleton, NULL)) {
|
||||
nm_log_err (LOGD_CORE, "failed to register DBus connection filter");
|
||||
g_set_error_literal (error, NM_MANAGER_ERROR, NM_MANAGER_ERROR_INTERNAL,
|
||||
"Failed to register DBus connection filter");
|
||||
g_object_unref (singleton);
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ typedef enum {
|
|||
NM_MANAGER_ERROR_DEPENDENCY_FAILED, /*< nick=DependencyFailed >*/
|
||||
NM_MANAGER_ERROR_AUTOCONNECT_NOT_ALLOWED, /*< nick=AutoconnectNotAllowed >*/
|
||||
NM_MANAGER_ERROR_CONNECTION_ALREADY_ACTIVE, /*< nick=ConnectionAlreadyActive >*/
|
||||
NM_MANAGER_ERROR_INTERNAL, /*< nick=Internal >*/
|
||||
} NMManagerError;
|
||||
|
||||
#define NM_MANAGER_VERSION "version"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue