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

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