[grilo] net: Better error message when a mock file is absent



commit e12b770ee53cb72083cfeaf95ec98f314288e9bc
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Dec 16 14:13:10 2015 +0100

    net: Better error message when a mock file is absent
    
    Now we'll print the path of the missing file, instead of a glib message
    about it.

 libs/net/grl-net-mock.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/libs/net/grl-net-mock.c b/libs/net/grl-net-mock.c
index ce9c367..0aebceb 100644
--- a/libs/net/grl-net-mock.c
+++ b/libs/net/grl-net-mock.c
@@ -106,16 +106,15 @@ get_url_mocked (GrlNetWc *self,
   if (data_file[0] != '/') {
     full_path = g_build_filename (base_path, data_file, NULL);
   } else {
-    full_path = data_file;
-    data_file = NULL;
+    full_path = g_strdup (data_file);
   }
 
   if (g_stat (full_path, &stat_buf) < 0) {
     g_simple_async_result_set_error (G_SIMPLE_ASYNC_RESULT (result),
                                      GRL_NET_WC_ERROR,
                                      GRL_NET_WC_ERROR_NOT_FOUND,
-                                     "%s",
-                                     _("Could not access mock content"));
+                                     _("Could not access mock content: %s"),
+                                     data_file);
     g_simple_async_result_complete_in_idle (G_SIMPLE_ASYNC_RESULT (result));
     g_object_unref (result);
     g_free (new_url);


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