libnm: make the the use of GInitable mandatory
Remove _nm_object_ensure_inited(), etc; objects that implement GInitable are now mandatory-to-init(). Remove constructor() implementations that sometimes return NULL; do all the relevant checking in init() instead. Make nm_client_new() and nm_remote_settings_new() take a GCancellable and a GError**.
This commit is contained in:
@@ -611,8 +611,9 @@ do_general (NmCli *nmc, int argc, char **argv)
|
||||
}
|
||||
|
||||
/* get system settings */
|
||||
if (!(rem_settings = nm_remote_settings_new (NULL))) {
|
||||
g_string_printf (nmc->return_text, _("Error: Could not get system settings."));
|
||||
if (!(rem_settings = nm_remote_settings_new (NULL, &error))) {
|
||||
g_string_printf (nmc->return_text, _("Error: Could not get system settings: %s."), error->message);
|
||||
g_clear_error (&error);
|
||||
nmc->return_value = NMC_RESULT_ERROR_UNKNOWN;
|
||||
goto finish;
|
||||
}
|
||||
|
Reference in New Issue
Block a user