[devhelp] Book: improve error messages



commit 2c1dc7186c44bfa2341df4a9452ef5f9deba66c3
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sun Dec 10 12:46:26 2017 +0100

    Book: improve error messages

 src/dh-book.c |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)
---
diff --git a/src/dh-book.c b/src/dh-book.c
index c0b6a25..4344acc 100644
--- a/src/dh-book.c
+++ b/src/dh-book.c
@@ -299,13 +299,15 @@ dh_book_new (GFile *index_file)
                                   &priv->links,
                                   &error)) {
                 if (error != NULL) {
-                        gchar *path;
+                        gchar *parse_name;
 
-                        path = g_file_get_path (priv->index_file);
+                        parse_name = g_file_get_parse_name (priv->index_file);
 
-                        g_warning ("Failed to read '%s': %s", path, error->message);
+                        g_warning ("Failed to read “%s”: %s",
+                                   parse_name,
+                                   error->message);
 
-                        g_free (path);
+                        g_free (parse_name);
                         g_clear_error (&error);
                 }
 
@@ -335,9 +337,15 @@ dh_book_new (GFile *index_file)
                                              &error);
 
         if (error != NULL) {
-                g_warning ("Couldn't setup monitoring of changes in book '%s': %s",
-                           priv->id,
+                gchar *parse_name;
+
+                parse_name = g_file_get_parse_name (priv->index_file);
+
+                g_warning ("Failed to create file monitor for file “%s”: %s",
+                           parse_name,
                            error->message);
+
+                g_free (parse_name);
                 g_clear_error (&error);
         }
 


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