Blame SOURCES/0009-hide-some-errors.patch

f91063
From 19c19d37ec9ba8b15b806158572a8e4a34c55677 Mon Sep 17 00:00:00 2001
f91063
From: Milan Crha <mcrha@redhat.com>
f91063
Date: Wed, 7 Sep 2022 09:01:16 +0200
f91063
Subject: [PATCH] misc: Hide some errors in non-debug builds
f91063
f91063
These two errors are useless for the users, they cannot do anything with them.
f91063
While it can be useful to know them, they can be also disturbing and they just
f91063
fill the journal log for the users.
f91063
f91063
Related to https://gitlab.gnome.org/GNOME/gnome-software/-/issues/753
f91063
---
f91063
 lib/gs-plugin-loader.c | 15 +++++++++++----
f91063
 src/gs-shell.c         | 15 +++++++++++----
f91063
 2 files changed, 22 insertions(+), 8 deletions(-)
f91063
f91063
diff --git a/lib/gs-plugin-loader.c b/lib/gs-plugin-loader.c
f91063
index 63f741c37..e040358b7 100644
f91063
--- a/lib/gs-plugin-loader.c
f91063
+++ b/lib/gs-plugin-loader.c
f91063
@@ -358,10 +358,17 @@ gs_plugin_loader_claim_error (GsPluginLoader *plugin_loader,
f91063
 
f91063
 	/* invalid */
f91063
 	if (error_copy->domain != GS_PLUGIN_ERROR) {
f91063
-		g_warning ("not GsPlugin error %s:%i: %s",
f91063
-			   g_quark_to_string (error_copy->domain),
f91063
-			   error_copy->code,
f91063
-			   error_copy->message);
f91063
+		if (g_strcmp0 (BUILD_TYPE, "debug") == 0) {
f91063
+			g_warning ("not GsPlugin error %s:%i: %s",
f91063
+				   g_quark_to_string (error_copy->domain),
f91063
+				   error_copy->code,
f91063
+				   error_copy->message);
f91063
+		} else {
f91063
+			g_debug ("not GsPlugin error %s:%i: %s",
f91063
+				 g_quark_to_string (error_copy->domain),
f91063
+				 error_copy->code,
f91063
+				 error_copy->message);
f91063
+		}
f91063
 		error_copy->domain = GS_PLUGIN_ERROR;
f91063
 		error_copy->code = GS_PLUGIN_ERROR_FAILED;
f91063
 	}
f91063
diff --git a/src/gs-shell.c b/src/gs-shell.c
f91063
index beb76f0e9..af297d240 100644
f91063
--- a/src/gs-shell.c
f91063
+++ b/src/gs-shell.c
f91063
@@ -2080,10 +2080,17 @@ gs_shell_rescan_events (GsShell *shell)
f91063
 			    !g_error_matches (error,
f91063
 					      G_IO_ERROR,
f91063
 					      G_IO_ERROR_CANCELLED)) {
f91063
-				g_warning ("not handling error %s for action %s: %s",
f91063
-					   gs_plugin_error_to_string (error->code),
f91063
-					   gs_plugin_action_to_string (action),
f91063
-					   error->message);
f91063
+				if (g_strcmp0 (BUILD_TYPE, "debug") == 0) {
f91063
+					g_warning ("not handling error %s for action %s: %s",
f91063
+						   gs_plugin_error_to_string (error->code),
f91063
+						   gs_plugin_action_to_string (action),
f91063
+						   error->message);
f91063
+				} else {
f91063
+					g_debug ("not handling error %s for action %s: %s",
f91063
+						 gs_plugin_error_to_string (error->code),
f91063
+						 gs_plugin_action_to_string (action),
f91063
+						 error->message);
f91063
+				}
f91063
 			}
f91063
 			gs_plugin_event_add_flag (event, GS_PLUGIN_EVENT_FLAG_INVALID);
f91063
 			return;
f91063
-- 
f91063
GitLab
f91063