[tracker/tracker-0.10] tracker-writeback: Add g_warning when file !native + improve other errors



commit c5b622ebf5f174bc3381e3707f15d0382b7fc6d4
Author: Martyn Russell <martyn lanedo com>
Date:   Tue Jul 26 16:46:27 2011 +0100

    tracker-writeback: Add g_warning when file !native + improve other errors
    
    The error messages didn't pertain to what the function was doing which made
    it quite generic. It's better to explain what we were attempting to give the
    logs more context when it occurs.

 src/tracker-writeback/tracker-writeback-file.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/tracker-writeback/tracker-writeback-file.c b/src/tracker-writeback/tracker-writeback-file.c
index d3124ff..7b5bef9 100644
--- a/src/tracker-writeback/tracker-writeback-file.c
+++ b/src/tracker-writeback/tracker-writeback-file.c
@@ -61,6 +61,12 @@ create_temporary_file (GFile     *file,
 	GError *error = NULL;
 
 	if (!g_file_is_native (file)) {
+		gchar *uri;
+
+		uri = g_file_get_uri (file);
+		g_warning ("Could not create temporary file, file is not native: '%s'", uri);
+		g_free (uri);
+
 		return NULL;
 	}
 
@@ -68,7 +74,7 @@ create_temporary_file (GFile     *file,
 	input_stream = G_INPUT_STREAM (g_file_read (file, NULL, &error));
 
 	if (error) {
-		g_critical ("Could not read the file: %s", error->message);
+		g_critical ("Could not create temporary file, %s", error->message);
 		g_error_free (error);
 		return NULL;
 	}
@@ -104,7 +110,7 @@ create_temporary_file (GFile     *file,
 	g_free (tmp_path);
 
 	if (error) {
-		g_critical ("Could not copy file: %s\n", error->message);
+		g_critical ("Could not copy temporary file, %s", error->message);
 		g_error_free (error);
 
 		g_file_delete (tmp_file, NULL, NULL);



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