[evolution-data-server/openismus-work-master] Fixing EBookBackendSqliteDB errors to all use explicit error codes.



commit d13216307986f7855ad950a5fb1e11aa8d7c08c4
Author: Tristan Van Berkom <tristanvb openismus com>
Date:   Mon Jan 21 18:12:03 2013 +0900

    Fixing EBookBackendSqliteDB errors to all use explicit error codes.
    
    Conflicts:
    
    	addressbook/libedata-book/e-book-backend-sqlitedb.c

 .../libedata-book/e-book-backend-sqlitedb.c        |   27 ++++++++++---------
 1 files changed, 14 insertions(+), 13 deletions(-)
---
diff --git a/addressbook/libedata-book/e-book-backend-sqlitedb.c b/addressbook/libedata-book/e-book-backend-sqlitedb.c
index 857b2a9..302d642 100644
--- a/addressbook/libedata-book/e-book-backend-sqlitedb.c
+++ b/addressbook/libedata-book/e-book-backend-sqlitedb.c
@@ -295,7 +295,7 @@ book_backend_sql_exec_real (sqlite3 *db,
 	if (ret != SQLITE_OK) {
 		d (g_print ("Error in SQL EXEC statement: %s [%s].\n", stmt, errmsg));
 		g_set_error_literal (
-			error, E_BOOK_SDB_ERROR, 0, errmsg);
+			error, E_BOOK_SDB_ERROR, E_BOOK_SDB_ERROR_OTHER, errmsg);
 		sqlite3_free (errmsg);
 		errmsg = NULL;
 		return FALSE;
@@ -736,7 +736,7 @@ introspect_summary (EBookBackendSqliteDB *ebsdb,
 		/* Check for parse error */
 		if (field == 0) {
 			g_set_error (
-				error, E_BOOK_SDB_ERROR, 0,
+				error, E_BOOK_SDB_ERROR, E_BOOK_SDB_ERROR_OTHER,
 				_("Error introspecting unknown summary field '%s'"), col);
 			success = FALSE;
 			break;
@@ -960,14 +960,15 @@ book_backend_sqlitedb_load (EBookBackendSqliteDB *ebsdb,
 	if (ret) {
 		if (!ebsdb->priv->db) {
 			g_set_error (
-				error, E_BOOK_SDB_ERROR, 0,
+				error, E_BOOK_SDB_ERROR,
+				E_BOOK_SDB_ERROR_OTHER,
 				_("Insufficient memory"));
 		} else {
 			const gchar *errmsg;
 			errmsg = sqlite3_errmsg (ebsdb->priv->db);
 			d (g_print ("Can't open database %s: %s\n", path, errmsg));
 			g_set_error_literal (
-				error, E_BOOK_SDB_ERROR, 0, errmsg);
+				error, E_BOOK_SDB_ERROR, E_BOOK_SDB_ERROR_OTHER, errmsg);
 			sqlite3_close (ebsdb->priv->db);
 		}
 		return FALSE;
@@ -1043,7 +1044,7 @@ e_book_backend_sqlitedb_new_internal (const gchar *path,
 	if (g_mkdir_with_parents (path, 0777) < 0) {
 		g_mutex_unlock (&dbcon_lock);
 		g_set_error (
-			error, E_BOOK_SDB_ERROR, 0,
+			error, E_BOOK_SDB_ERROR, E_BOOK_SDB_ERROR_OTHER,
 			"Can not make parent directory: errno %d", errno);
 		return NULL;
 	}
@@ -1095,7 +1096,7 @@ append_summary_field (GArray *array,
 
 	if (field < 1 || field >= E_CONTACT_FIELD_LAST) {
 		g_set_error (
-			error, E_BOOK_SDB_ERROR, 0,
+			error, E_BOOK_SDB_ERROR, E_BOOK_SDB_ERROR_OTHER,
 			_("Invalid contact field '%d' specified in summary"), field);
 		return FALSE;
 	}
@@ -1129,7 +1130,7 @@ append_summary_field (GArray *array,
 	    type != G_TYPE_BOOLEAN &&
 	    type != E_TYPE_CONTACT_ATTR_LIST) {
 		g_set_error (
-			error, E_BOOK_SDB_ERROR, 0,
+			error, E_BOOK_SDB_ERROR, E_BOOK_SDB_ERROR_OTHER,
 			_("Contact field '%s' of type '%s' specified in summary, "
 			"but only boolean, string and string list field types are supported"),
 			e_contact_pretty_name (field), g_type_name (type));
@@ -2120,7 +2121,7 @@ e_book_backend_sqlitedb_get_vcard_string (EBookBackendSqliteDB *ebsdb,
 		local_with_all_required_fields = TRUE;
 	} else {
 		g_set_error (
-			error, E_BOOK_SDB_ERROR, 0,
+			error, E_BOOK_SDB_ERROR, E_BOOK_SDB_ERROR_OTHER,
 			_("Full search_contacts are not stored in cache. vcards cannot be returned."));
 
 	}
@@ -2133,7 +2134,7 @@ e_book_backend_sqlitedb_get_vcard_string (EBookBackendSqliteDB *ebsdb,
 	/* Is is an error to not find a contact ?? */
 	if (!vcard_str && error && !*error)
 		g_set_error (
-			error, E_BOOK_SDB_ERROR, 0,
+			error, E_BOOK_SDB_ERROR, E_BOOK_SDB_ERROR_OTHER,
 			_("Contact '%s' not found"), uid ? uid : "NULL");
 
 	return vcard_str;
@@ -2916,7 +2917,7 @@ book_backend_sqlitedb_search_query (EBookBackendSqliteDB *ebsdb,
 		local_with_all_required_fields = TRUE;
 	} else {
 		g_set_error (
-			error, E_BOOK_SDB_ERROR, 0,
+			error, E_BOOK_SDB_ERROR, E_BOOK_SDB_ERROR_OTHER,
 			_("Full search_contacts are not stored in cache. vcards cannot be returned."));
 	}
 
@@ -3058,7 +3059,7 @@ e_book_backend_sqlitedb_search (EBookBackendSqliteDB *ebsdb,
 
 	} else {
 		g_set_error (
-			error, E_BOOK_SDB_ERROR, 0,
+			error, E_BOOK_SDB_ERROR, E_BOOK_SDB_ERROR_OTHER,
 			_("Full search_contacts are not stored in cache. "
 			"Hence only summary query is supported."));
 	}
@@ -3139,7 +3140,7 @@ e_book_backend_sqlitedb_search_uids (EBookBackendSqliteDB *ebsdb,
 
 	} else {
 		g_set_error (
-			error, E_BOOK_SDB_ERROR, 0,
+			error, E_BOOK_SDB_ERROR, E_BOOK_SDB_ERROR_OTHER,
 			_("Full vcards are not stored in cache. "
 			"Hence only summary query is supported."));
 	}
@@ -3811,7 +3812,7 @@ e_book_backend_sqlitedb_remove (EBookBackendSqliteDB *ebsdb,
 
 	if (ret == -1) {
 		g_set_error (
-			error, E_BOOK_SDB_ERROR, 0,
+			error, E_BOOK_SDB_ERROR, E_BOOK_SDB_ERROR_OTHER,
 			_("Unable to remove the db file: errno %d"), errno);
 		return FALSE;
 	}



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