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



commit 4bb76db8ba6debaa94abc44b36f465d2cb4140f0
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 fb97347..0531c9d 100644
--- a/addressbook/libedata-book/e-book-backend-sqlitedb.c
+++ b/addressbook/libedata-book/e-book-backend-sqlitedb.c
@@ -2134,10 +2134,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]