[gnome-builder/gnome-builder-3-20] autotools: pass GLib.Error to task



commit f2a1c7f4322e779b8b16863c888221f60106bd1c
Author: Christian Hergert <chergert redhat com>
Date:   Fri May 13 16:07:51 2016 +0300

    autotools: pass GLib.Error to task
    
    If we have a GLib.Error, then we don't need to translate it into a
    new GLib.Error. Simply pass it along to the GTask.

 .../autotools_templates/__init__.py                |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/plugins/autotools-templates/autotools_templates/__init__.py 
b/plugins/autotools-templates/autotools_templates/__init__.py
index cf6f7eb..62c4ed6 100644
--- a/plugins/autotools-templates/autotools_templates/__init__.py
+++ b/plugins/autotools-templates/autotools_templates/__init__.py
@@ -181,8 +181,10 @@ class AutotoolsTemplate(Ide.TemplateBase, Ide.ProjectTemplate):
             self.expand_all_finish(result)
             task.return_boolean(True)
         except Exception as exc:
-            print(exc)
-            task.return_error(GLib.Error(repr(exc)))
+            if isinstance(exc, GLib.Error):
+                task.return_error(exc)
+            else:
+                task.return_error(GLib.Error(repr(exc)))
 
     def prepare_scope(self, scope):
         pass


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