summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-04-30 12:56:25 +0200
committerThomas Haller <thaller@redhat.com>2016-05-03 11:52:40 +0200
commitc71bd9df82531e00940602ac91c78675336fecbe (patch)
tree2ad648afc231cd4be925a2e8c1465c33858be0b5
parenta51b947f252953e2c5ea75dea60fc38de101872b (diff)
downloadNetworkManager-c71bd9df82531e00940602ac91c78675336fecbe.tar.gz
device: improve error message for failure to reapply
-rw-r--r--src/devices/nm-device.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 6894cbb49c..ad6f835f40 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -7334,13 +7334,20 @@ _hash_check_invalid_keys_impl (GHashTable *hash, const char *setting_name, GErro
break;
}
}
- g_set_error (error,
- NM_DEVICE_ERROR,
- NM_DEVICE_ERROR_INCOMPATIBLE_CONNECTION,
- "Can't reapply changes to '%s%s%s' setting",
- setting_name ? : "",
- setting_name ? "." : "",
- first_invalid_key ? : "<UNKNOWN>");
+ if (setting_name) {
+ g_set_error (error,
+ NM_DEVICE_ERROR,
+ NM_DEVICE_ERROR_INCOMPATIBLE_CONNECTION,
+ "Can't reapply changes to '%s.%s' setting",
+ setting_name,
+ first_invalid_key);
+ } else {
+ g_set_error (error,
+ NM_DEVICE_ERROR,
+ NM_DEVICE_ERROR_INCOMPATIBLE_CONNECTION,
+ "Can't reapply any changes to '%s' setting",
+ first_invalid_key);
+ }
g_return_val_if_fail (first_invalid_key, FALSE);
return FALSE;
}