[gnome-software/gnome-41: 1/3] gs-plugin-event: Ensure the error message does not contain D-Bus remote error




commit 167fa21398073037ce6cfae8f11ad1e9616754e7
Author: Milan Crha <mcrha redhat com>
Date:   Fri Oct 1 12:59:08 2021 +0200

    gs-plugin-event: Ensure the error message does not contain D-Bus remote error
    
    Just in case the caller did not remove it on its own. This does not work
    when the error message is prefixed with some text.

 lib/gs-plugin-event.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/lib/gs-plugin-event.c b/lib/gs-plugin-event.c
index 1be73e121..cc831b458 100644
--- a/lib/gs-plugin-event.c
+++ b/lib/gs-plugin-event.c
@@ -251,6 +251,10 @@ gs_plugin_event_set_error (GsPluginEvent *event, const GError *error)
 {
        g_clear_error (&event->error);
        event->error = g_error_copy (error);
+       if (event->error) {
+               /* Just in case the caller left there any D-Bus remote error notes */
+               g_dbus_error_strip_remote_error (event->error);
+       }
 }
 
 /**


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]