network: Add checks for cancelled calls
This commit is contained in:
parent
700e5e544c
commit
fe6e71198c
1 changed files with 16 additions and 13 deletions
|
@ -344,8 +344,9 @@ get_secrets_cb (GObject *source_object,
|
||||||
|
|
||||||
secrets = nm_remote_connection_get_secrets_finish (NM_REMOTE_CONNECTION (source_object), res, &error);
|
secrets = nm_remote_connection_get_secrets_finish (NM_REMOTE_CONNECTION (source_object), res, &error);
|
||||||
if (!secrets) {
|
if (!secrets) {
|
||||||
|
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
||||||
|
g_warning ("Could not get secrets: %s", error->message);
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
//FIXME ignore cancelled
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -651,12 +652,13 @@ connection_add_activate_cb (GObject *source_object,
|
||||||
|
|
||||||
conn = nm_client_add_and_activate_connection_finish (NM_CLIENT (source_object), res, &error);
|
conn = nm_client_add_and_activate_connection_finish (NM_CLIENT (source_object), res, &error);
|
||||||
if (!conn) {
|
if (!conn) {
|
||||||
//FIXME cancelled
|
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
|
||||||
nm_device_wifi_refresh_ui (user_data);
|
nm_device_wifi_refresh_ui (user_data);
|
||||||
/* failed to activate */
|
/* failed to activate */
|
||||||
g_debug ("Failed to add and activate connection '%d': %s",
|
g_warning ("Failed to add and activate connection '%d': %s",
|
||||||
error->code,
|
error->code,
|
||||||
error->message);
|
error->message);
|
||||||
|
}
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -670,12 +672,13 @@ connection_activate_cb (GObject *source_object,
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
if (!nm_client_activate_connection_finish (NM_CLIENT (source_object), res, &error)) {
|
if (!nm_client_activate_connection_finish (NM_CLIENT (source_object), res, &error)) {
|
||||||
//FIXME cancelled
|
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
|
||||||
nm_device_wifi_refresh_ui (user_data);
|
nm_device_wifi_refresh_ui (user_data);
|
||||||
/* failed to activate */
|
/* failed to activate */
|
||||||
g_debug ("Failed to add and activate connection '%d': %s",
|
g_debug ("Failed to add and activate connection '%d': %s",
|
||||||
error->code,
|
error->code,
|
||||||
error->message);
|
error->message);
|
||||||
|
}
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue