[evolution-data-server/openismus-work-master] EBookBackendSqliteDB: Added contact-not-found error type.



commit ec05316e664f6cf454c98d0c91448aa2abef371d
Author: Tristan Van Berkom <tristanvb openismus com>
Date:   Mon Jan 21 17:50:55 2013 +0900

    EBookBackendSqliteDB: Added contact-not-found error type.
    
    Report this error if a contact was requested by UID and not found.

 .../libedata-book/e-book-backend-sqlitedb.c        |    3 +--
 .../libedata-book/e-book-backend-sqlitedb.h        |    3 +++
 2 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/addressbook/libedata-book/e-book-backend-sqlitedb.c b/addressbook/libedata-book/e-book-backend-sqlitedb.c
index 302d642..aefcb25 100644
--- a/addressbook/libedata-book/e-book-backend-sqlitedb.c
+++ b/addressbook/libedata-book/e-book-backend-sqlitedb.c
@@ -2131,10 +2131,9 @@ e_book_backend_sqlitedb_get_vcard_string (EBookBackendSqliteDB *ebsdb,
 	if (with_all_required_fields)
 		*with_all_required_fields = local_with_all_required_fields;
 
-	/* Is is an error to not find a contact ?? */
 	if (!vcard_str && error && !*error)
 		g_set_error (
-			error, E_BOOK_SDB_ERROR, E_BOOK_SDB_ERROR_OTHER,
+			error, E_BOOK_SDB_ERROR, E_BOOK_SDB_ERROR_CONTACT_NOT_FOUND,
 			_("Contact '%s' not found"), uid ? uid : "NULL");
 
 	return vcard_str;
diff --git a/addressbook/libedata-book/e-book-backend-sqlitedb.h b/addressbook/libedata-book/e-book-backend-sqlitedb.h
index 8d6de5e..a451415 100644
--- a/addressbook/libedata-book/e-book-backend-sqlitedb.h
+++ b/addressbook/libedata-book/e-book-backend-sqlitedb.h
@@ -65,12 +65,15 @@ typedef struct _EBookBackendSqliteDBPrivate EBookBackendSqliteDBPrivate;
 /**
  * EBookSDBError:
  * @E_BOOK_SDB_ERROR_CONSTRAINT: The error occurred due to an explicit constraint
+ * @E_BOOK_SDB_ERROR_CONTACT_NOT_FOUND: A contact was not found by UID (this is different
+ *                                      from a query that returns no results, which is not an error).
  * @E_BOOK_SDB_ERROR_OTHER: Another error occurred
  *
  * Defines the types of possible errors reported by the #EBookBackendSqliteDB
  */
 typedef enum {
 	E_BOOK_SDB_ERROR_CONSTRAINT,
+	E_BOOK_SDB_ERROR_CONTACT_NOT_FOUND,
 	E_BOOK_SDB_ERROR_OTHER
 } EBookSDBError;
 



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