[gnome-software/wip/kalev/more-flatpak-fixes: 3/3] flatpak: Keep going when we get a non fatal error



commit 27142746f38c0b65fc26052c5e98e191c1e63869
Author: Kalev Lember <klember redhat com>
Date:   Thu Oct 4 09:42:20 2018 +0200

    flatpak: Keep going when we get a non fatal error
    
    This is what the flatpak CLI does, so let's do it here as well. A
    non-fatal error can happen when e.g. one of the related refs fails to
    install.

 plugins/flatpak/gs-flatpak-transaction.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
---
diff --git a/plugins/flatpak/gs-flatpak-transaction.c b/plugins/flatpak/gs-flatpak-transaction.c
index 2b78a331..35708d91 100644
--- a/plugins/flatpak/gs-flatpak-transaction.c
+++ b/plugins/flatpak/gs-flatpak-transaction.c
@@ -288,8 +288,22 @@ _transaction_operation_error (FlatpakTransaction *transaction,
                              FlatpakTransactionErrorDetails detail)
 {
        GsFlatpakTransaction *self = GS_FLATPAK_TRANSACTION (transaction);
+       FlatpakTransactionOperationType operation_type = flatpak_transaction_operation_get_operation_type 
(operation);
+       const gchar *ref = flatpak_transaction_operation_get_ref (operation);
 
        if (g_error_matches (error, FLATPAK_ERROR, FLATPAK_ERROR_SKIPPED)) {
+               g_debug ("skipped to %s %s: %s",
+                        _flatpak_transaction_operation_type_to_string (operation_type),
+                        ref,
+                        error->message);
+               return TRUE; /* continue */
+       }
+
+       if (detail & FLATPAK_TRANSACTION_ERROR_DETAILS_NON_FATAL) {
+               g_warning ("failed to %s %s (non fatal): %s",
+                          _flatpak_transaction_operation_type_to_string (operation_type),
+                          ref,
+                          error->message);
                return TRUE; /* continue */
        }
 


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