[grilo] net: use G_IO_ERROR_FAILED instead of GRL_NET_WC_ERROR_UNAVAILABLE



commit ea1f42338261d733a5922089e848c6acc372c010
Author: Victor Toso <me victortoso com>
Date:   Sat Jun 4 22:27:11 2016 +0200

    net: use G_IO_ERROR_FAILED instead of GRL_NET_WC_ERROR_UNAVAILABLE
    
    https://bugzilla.gnome.org/show_bug.cgi?id=764077

 libs/net/grl-net-wc.c |   12 ++++++------
 libs/net/grl-net-wc.h |    3 ++-
 2 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/libs/net/grl-net-wc.c b/libs/net/grl-net-wc.c
index c798847..96b5d1d 100644
--- a/libs/net/grl-net-wc.c
+++ b/libs/net/grl-net-wc.c
@@ -595,8 +595,8 @@ read_async_cb (GObject *source,
                                        G_IO_ERROR_CANCELLED,
                                        _("Operation was cancelled"));
     } else {
-      g_simple_async_result_set_error (result, GRL_NET_WC_ERROR,
-                                       GRL_NET_WC_ERROR_UNAVAILABLE,
+      g_simple_async_result_set_error (result, G_IO_ERROR,
+                                       G_IO_ERROR_FAILED,
                                        _("Data not available"));
     }
 
@@ -639,8 +639,8 @@ reply_cb (GObject *source,
     if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
       g_simple_async_result_set_from_error (result, error);
     } else {
-      g_simple_async_result_set_error (result, GRL_NET_WC_ERROR,
-                                       GRL_NET_WC_ERROR_UNAVAILABLE,
+      g_simple_async_result_set_error (result, G_IO_ERROR,
+                                       G_IO_ERROR_FAILED,
                                        _("Data not available"));
     }
     g_error_free (error);
@@ -690,8 +690,8 @@ get_url_now (GrlNetWc *self,
 
   if (!rr->request) {
     g_simple_async_result_set_error (G_SIMPLE_ASYNC_RESULT (result),
-                                     GRL_NET_WC_ERROR,
-                                     GRL_NET_WC_ERROR_UNAVAILABLE,
+                                     G_IO_ERROR,
+                                     G_IO_ERROR_INVALID_ARGUMENT,
                                      _("Invalid URL %s"),
                                      url);
     g_simple_async_result_complete (G_SIMPLE_ASYNC_RESULT (result));
diff --git a/libs/net/grl-net-wc.h b/libs/net/grl-net-wc.h
index d28fb77..00866bd 100644
--- a/libs/net/grl-net-wc.h
+++ b/libs/net/grl-net-wc.h
@@ -33,7 +33,8 @@ G_BEGIN_DECLS
 
 /**
  * GrlNetWcError:
- * @GRL_NET_WC_ERROR_UNAVAILABLE: TBD
+ * @GRL_NET_WC_ERROR_UNAVAILABLE: Deprecated. For generic errors, you
+ * should check for G_IO_ERROR_FAILED from G_IO_ERROR domain.
  * @GRL_NET_WC_ERROR_PROTOCOL_ERROR: Invalid URI or header
  * @GRL_NET_WC_ERROR_AUTHENTICATION_REQUIRED: Required authentication
  * @GRL_NET_WC_ERROR_NOT_FOUND: Request resource not found


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