From dbe825c5a1ad76b6b5577bde804e15cc921e1f29 Mon Sep 17 00:00:00 2001 From: Tristan Van Berkom Date: Wed, 27 Feb 2013 20:08:45 +0900 Subject: [PATCH] EBookBackendFile: Properly translate E_BOOK_SDB_ERROR_QUERY_INVALID errors --- addressbook/backends/file/e-book-backend-file.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/addressbook/backends/file/e-book-backend-file.c b/addressbook/backends/file/e-book-backend-file.c index 53ac1be..4b530f3 100644 --- a/addressbook/backends/file/e-book-backend-file.c +++ b/addressbook/backends/file/e-book-backend-file.c @@ -1084,6 +1084,15 @@ e_book_backend_file_get_contact_list (EBookBackendSync *backend, E_DATA_BOOK_STATUS_NOT_SUPPORTED, _("Query '%s' not supported"), query); g_error_free (local_error); + + } else if (g_error_matches (local_error, + E_BOOK_SDB_ERROR, + E_BOOK_SDB_ERROR_INVALID_QUERY)) { + g_set_error (perror, E_DATA_BOOK_ERROR, + E_DATA_BOOK_STATUS_INVALID_QUERY, + _("Invalid Query '%s'"), query); + g_error_free (local_error); + } else { g_warning ("Failed to fetch contact ids: %s", local_error->message); g_propagate_error (perror, local_error); @@ -1123,6 +1132,15 @@ e_book_backend_file_get_contact_list_uids (EBookBackendSync *backend, E_DATA_BOOK_STATUS_NOT_SUPPORTED, _("Query '%s' not supported"), query); g_error_free (local_error); + + } else if (g_error_matches (local_error, + E_BOOK_SDB_ERROR, + E_BOOK_SDB_ERROR_INVALID_QUERY)) { + g_set_error (perror, E_DATA_BOOK_ERROR, + E_DATA_BOOK_STATUS_INVALID_QUERY, + _("Invalid Query '%s'"), query); + g_error_free (local_error); + } else { g_warning ("Failed to fetch contact ids: %s", local_error->message); g_propagate_error (perror, local_error); -- 2.7.4