[gnome-software/1470-never-show-quark-ids-in-user-visible-error-messages] gs-plugin-event: Ensure the error message does not contain D-Bus remote error



commit e28a7230d9a3b0e8eb5b59c76b7de996144a9e43
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]