[gnome-software/gnome-3-38: 2/4] fwupd: add some missing instances of error conversion




commit 1720e7b4366ed4c3c0d91cb9ab072c7f721824bc
Author: Mario Limonciello <mario limonciello dell com>
Date:   Tue Dec 8 09:28:30 2020 -0600

    fwupd: add some missing instances of error conversion
    
    This should prevent FwupdError domain from leaking up to the GUI.
    
    Suggested-by: Milan Crha <mcrha redhat com>
    Signed-off-by: Mario Limonciello <mario limonciello dell com>

 plugins/fwupd/gs-plugin-fwupd.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/plugins/fwupd/gs-plugin-fwupd.c b/plugins/fwupd/gs-plugin-fwupd.c
index ba25d0d83..3775b8a4c 100644
--- a/plugins/fwupd/gs-plugin-fwupd.c
+++ b/plugins/fwupd/gs-plugin-fwupd.c
@@ -225,6 +225,7 @@ gs_plugin_setup (GsPlugin *plugin, GCancellable *cancellable, GError **error)
        /* we know the runtime daemon version now */
        fwupd_client_set_user_agent_for_package (priv->client, PACKAGE_NAME, PACKAGE_VERSION);
        if (!fwupd_client_ensure_networking (priv->client, error)) {
+               gs_plugin_fwupd_error_convert (error);
                g_prefix_error (error, "Failed to setup networking: ");
                return FALSE;
        }
@@ -760,8 +761,10 @@ gs_plugin_refresh (GsPlugin *plugin,
 
        /* get the list of enabled remotes */
        remotes = fwupd_client_get_remotes (priv->client, cancellable, error);
-       if (remotes == NULL)
+       if (remotes == NULL) {
+               gs_plugin_fwupd_error_convert (error);
                return FALSE;
+       }
        for (guint i = 0; i < remotes->len; i++) {
                FwupdRemote *remote = g_ptr_array_index (remotes, i);
                if (!fwupd_remote_get_enabled (remote))


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