[tracker/error-handling: 8/10] libtracker-data: Use original error code in db_journal_reader_init



commit 9dfdfac5f3ed531b8c8ceace177c3679af2d166b
Author: Jürg Billeter <j bitron ch>
Date:   Tue May 17 16:20:27 2011 +0200

    libtracker-data: Use original error code in db_journal_reader_init
    
    tracker_data_manager_init matches against specific error codes.

 src/libtracker-data/tracker-db-journal.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/libtracker-data/tracker-db-journal.c b/src/libtracker-data/tracker-db-journal.c
index 9068428..bc50d8e 100644
--- a/src/libtracker-data/tracker-db-journal.c
+++ b/src/libtracker-data/tracker-db-journal.c
@@ -1382,14 +1382,14 @@ db_journal_reader_init (JournalReader  *jreader,
 		    !g_error_matches (n_error, G_FILE_ERROR, G_FILE_ERROR_NOENT)) {
 			/* Do not set error if the file does not exist, just return FALSE */
 
-			g_set_error (error, TRACKER_DB_JOURNAL_ERROR,
-			             TRACKER_DB_JOURNAL_ERROR_UNKNOWN,
-			             "Could not create TrackerDBJournalReader for file '%s', %s",
-			             jreader->filename,
-			             n_error->message ? n_error->message : "no error given");
+			g_propagate_prefixed_error (error,
+			                            n_error,
+			                            "Could not create TrackerDBJournalReader for file '%s', ",
+			                            jreader->filename);
+		} else {
+			g_error_free (n_error);
 		}
 
-		g_error_free (n_error);
 		g_free (filename_open);
 
 		tracker_db_journal_reader_shutdown ();



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