[evolution-data-server/openismus-work-master: 12/12] EBookBackendFile: Report the proper error if a contact is not found by UID.
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/openismus-work-master: 12/12] EBookBackendFile: Report the proper error if a contact is not found by UID.
- Date: Tue, 22 Jan 2013 06:38:54 +0000 (UTC)
commit ba4c4cef0c2fe9aa4fb1e8fe12c75294c43c17ad
Author: Tristan Van Berkom <tristanvb openismus com>
Date: Mon Jan 21 18:06:15 2013 +0900
EBookBackendFile: Report the proper error if a contact is not found by UID.
addressbook/backends/file/e-book-backend-file.c | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/addressbook/backends/file/e-book-backend-file.c b/addressbook/backends/file/e-book-backend-file.c
index 1e9ba4a..e7bc6cd 100644
--- a/addressbook/backends/file/e-book-backend-file.c
+++ b/addressbook/backends/file/e-book-backend-file.c
@@ -1017,6 +1017,7 @@ e_book_backend_file_get_contact (EBookBackendSync *backend,
GError **perror)
{
EBookBackendFile *bf = E_BOOK_BACKEND_FILE (backend);
+ GError *local_error = NULL;
if (!bf || !bf->priv || !bf->priv->sqlitedb) {
g_propagate_error (perror, EDB_NOT_OPENED_ERROR);
@@ -1027,7 +1028,22 @@ e_book_backend_file_get_contact (EBookBackendSync *backend,
*vcard = e_book_backend_sqlitedb_get_vcard_string (bf->priv->sqlitedb,
SQLITEDB_FOLDER_ID, id,
- NULL, NULL, perror);
+ NULL, NULL, &local_error);
+
+ if (local_error) {
+
+ if (g_error_matches (local_error,
+ E_BOOK_SDB_ERROR,
+ E_BOOK_SDB_ERROR_CONTACT_NOT_FOUND)) {
+ g_set_error (perror, E_DATA_BOOK_ERROR,
+ E_DATA_BOOK_STATUS_CONTACT_NOT_FOUND,
+ _("Conflicting UIDs found in added contacts"));
+ g_error_free (local_error);
+ } else
+ g_propagate_error (perror, local_error);
+
+ }
+
g_rw_lock_reader_unlock (&(bf->priv->lock));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]