[gnome-builder] gca: don't return an error when not available



commit fd96d48628bc29ebe181acf2a545027be91348bd
Author: Cosimo Cecchi <cosimo endlessm com>
Date:   Wed Dec 28 15:16:17 2016 -0800

    gca: don't return an error when not available
    
    Avoid a critical warning in that case.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=779976

 .../ide-gca-diagnostic-provider.c                  |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/plugins/gnome-code-assistance/ide-gca-diagnostic-provider.c 
b/plugins/gnome-code-assistance/ide-gca-diagnostic-provider.c
index 95f7384..2c88338 100644
--- a/plugins/gnome-code-assistance/ide-gca-diagnostic-provider.c
+++ b/plugins/gnome-code-assistance/ide-gca-diagnostic-provider.c
@@ -273,8 +273,17 @@ parse_cb (GObject      *object,
 
   if (!ret)
     {
-      IDE_TRACE_MSG ("%s", error->message);
-      g_task_return_error (task, error);
+      if (g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_SERVICE_UNKNOWN))
+        {
+          g_task_return_pointer (task, ide_diagnostics_new (NULL),
+                                 (GDestroyNotify)ide_diagnostics_unref);
+        }
+      else
+        {
+          IDE_TRACE_MSG ("%s", error->message);
+          g_task_return_error (task, error);
+        }
+
       IDE_EXIT;
     }
 


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