libnm-glib: tighter warning print checks
Should be checking for dbus-glib errors of the right type, instead of any error code (dbus-glib or not) that happens to be 4.
This commit is contained in:
@@ -496,7 +496,7 @@ _nm_object_get_property (NMObject *object,
|
|||||||
/* Don't warn about D-Bus no reply/timeout errors; it's mostly noise and
|
/* Don't warn about D-Bus no reply/timeout errors; it's mostly noise and
|
||||||
* happens for example when NM quits and the applet is still running.
|
* happens for example when NM quits and the applet is still running.
|
||||||
*/
|
*/
|
||||||
if (err->code != DBUS_GERROR_NO_REPLY) {
|
if (!(err->domain == DBUS_GERROR && err->code == DBUS_GERROR_NO_REPLY)) {
|
||||||
g_warning ("%s: Error getting '%s' for %s: (%d) %s\n",
|
g_warning ("%s: Error getting '%s' for %s: (%d) %s\n",
|
||||||
__func__,
|
__func__,
|
||||||
prop_name,
|
prop_name,
|
||||||
|
@@ -90,10 +90,15 @@ get_all_cb (DBusGProxy *proxy,
|
|||||||
if (!dbus_g_proxy_end_call (proxy, call, &error,
|
if (!dbus_g_proxy_end_call (proxy, call, &error,
|
||||||
DBUS_TYPE_G_MAP_OF_VARIANT, &props,
|
DBUS_TYPE_G_MAP_OF_VARIANT, &props,
|
||||||
G_TYPE_INVALID)) {
|
G_TYPE_INVALID)) {
|
||||||
|
/* Don't warn when the call times out because the settings service can't
|
||||||
|
* be activated or whatever.
|
||||||
|
*/
|
||||||
|
if (!(error->domain == DBUS_GERROR && error->code == DBUS_GERROR_NO_REPLY)) {
|
||||||
g_warning ("%s: couldn't retrieve system settings properties: (%d) %s.",
|
g_warning ("%s: couldn't retrieve system settings properties: (%d) %s.",
|
||||||
__func__,
|
__func__,
|
||||||
error ? error->code : -1,
|
error ? error->code : -1,
|
||||||
(error && error->message) ? error->message : "(unknown)");
|
(error && error->message) ? error->message : "(unknown)");
|
||||||
|
}
|
||||||
g_clear_error (&error);
|
g_clear_error (&error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user