[gnome-builder] flatpak: Gracefully handle download errors



commit 125b731abad92ceaaff31bf83ab8e3008a58026d
Author: Krzesimir Nowak <krzesimir kinvolk io>
Date:   Tue Mar 7 16:29:32 2017 +0100

    flatpak: Gracefully handle download errors
    
    We should return the error immediately if downloading the archive
    failed. Also, we shouldn't try to open a flatpak project if download
    failed.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=779802

 plugins/flatpak/gbp-flatpak-clone-widget.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/plugins/flatpak/gbp-flatpak-clone-widget.c b/plugins/flatpak/gbp-flatpak-clone-widget.c
index 1d48b33..27427e5 100644
--- a/plugins/flatpak/gbp-flatpak-clone-widget.c
+++ b/plugins/flatpak/gbp-flatpak-clone-widget.c
@@ -278,6 +278,9 @@ gbp_flatpak_clone_widget_worker_completed (GTask      *task,
                            "fraction", 1.0,
                            NULL);
 
+  if (g_task_had_error (task))
+    return;
+
   /* Wait for a second so animations can complete before opening
    * the project. Otherwise, it's pretty jarring to the user.
    */
@@ -393,6 +396,11 @@ gbp_flatpak_clone_widget_worker (GTask        *task,
                                          req->destination,
                                          self->strip_components,
                                          &error);
+      if (error != NULL)
+       {
+         g_task_return_error (task, error);
+         return;
+       }
     }
 
   for (i = 0; req->src->patches[i]; i++)


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