From 7dc72303aafef09666c50da71bf79b5253063e36 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 15 Oct 2024 15:26:38 +0100 Subject: [PATCH] printing: If we cannot contact Avahi, debug-log the error message If we get a G_IO_ERROR_DBUS_ERROR here, we shouldn't make too much noise about it by default, but it's still a useful data point for debugging and diagnosis. Signed-off-by: Simon McVittie --- modules/printbackends/gtkprintbackendcups.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/printbackends/gtkprintbackendcups.c b/modules/printbackends/gtkprintbackendcups.c index 7548067aae..b08c405454 100644 --- a/modules/printbackends/gtkprintbackendcups.c +++ b/modules/printbackends/gtkprintbackendcups.c @@ -3547,8 +3547,9 @@ avahi_service_browser_new_cb (GObject *source_object, * The creation of ServiceBrowser fails with G_IO_ERROR_DBUS_ERROR * if Avahi is disabled. */ - if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_DBUS_ERROR) && - !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) + if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_DBUS_ERROR)) + g_debug ("%s #%d: %s", g_quark_to_string (error->domain), error->code, error->message); + else if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) g_warning ("%s", error->message); g_error_free (error); }