[gnome-software/1883-trying-to-run-a-flatpak-app-whose-runtime-is-missing-fails-silently] gs-shell: Show all "not-supported" errors of an app launch



commit c88551175356f7df03ee1c28a3064d359f232b55
Author: Milan Crha <mcrha redhat com>
Date:   Thu Sep 1 17:24:47 2022 +0200

    gs-shell: Show all "not-supported" errors of an app launch
    
    Do not silently ignore "not-supported" errors when they do not have
    enough information to show a more detailed error, otherwise there
    is no GUI feedback about the failed launch, which confuses the users,
    thinking it's starting for a long time, instead of knowing why
    the launch failed.
    
    Closes https://gitlab.gnome.org/GNOME/gnome-software/-/issues/1883

 src/gs-shell.c | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/src/gs-shell.c b/src/gs-shell.c
index e4dcceccb..e1daed735 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -1831,6 +1831,13 @@ gs_shell_show_event_launch (GsShell *shell, GsPluginEvent *event)
                        g_string_append_printf (str, _("Unable to launch %s: %s is not installed"),
                                                str_app,
                                                str_origin);
+               } else {
+                       /* non-interactive generic */
+                       if (!gs_plugin_event_has_flag (event, GS_PLUGIN_EVENT_FLAG_INTERACTIVE))
+                               return FALSE;
+                       /* TRANSLATORS: we failed to get a proper error code */
+                       g_string_append (str, _("Sorry, something went wrong"));
+                       gs_shell_append_detailed_error (shell, str, error);
                }
        } else if (g_error_matches (error, GS_PLUGIN_ERROR, GS_PLUGIN_ERROR_NO_SPACE)) {
                /* TRANSLATORS: failure text for the in-app notification */


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