From: Tristan Van Berkom Date: Thu, 14 Nov 2013 08:40:59 +0000 (+0900) Subject: EBookBackendFile: Reduce uneeded warnings in server logs X-Git-Tag: submit/tizen/20140917.130222~379 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=90683f463ea4ee2f95d70e0f10ac65bf4e8a7aa1;p=platform%2Fupstream%2Fevolution-data-server.git EBookBackendFile: Reduce uneeded warnings in server logs With this patch, only unknown errors, which the user is not expected to handle or recover from (such as internal SQLite errors or file system errors), are warned about in the stderr. --- diff --git a/addressbook/backends/file/e-book-backend-file.c b/addressbook/backends/file/e-book-backend-file.c index 4f4a547..b166e6d 100644 --- a/addressbook/backends/file/e-book-backend-file.c +++ b/addressbook/backends/file/e-book-backend-file.c @@ -836,8 +836,6 @@ do_create (EBookBackendFile *bf, slist, FALSE, &local_error)) { - g_warning ("Failed to add contacts: %s", local_error->message); - if (g_error_matches (local_error, E_BOOK_SDB_ERROR, E_BOOK_SDB_ERROR_CONSTRAINT)) { @@ -846,8 +844,10 @@ do_create (EBookBackendFile *bf, E_BOOK_CLIENT_ERROR_CONTACT_ID_ALREADY_EXISTS, _("Conflicting UIDs found in added contacts")); g_clear_error (&local_error); - } else + } else { + g_warning ("Failed to add contacts: %s", local_error->message); g_propagate_error (error, local_error); + } status = STATUS_ERROR; } @@ -1439,7 +1439,6 @@ book_backend_file_remove_contacts_sync (EBookBackend *backend, removed_ids = g_slist_prepend (removed_ids, g_strdup (uids[ii])); removed_contacts = g_slist_prepend (removed_contacts, contact); } else { - g_warning ("Failed to fetch contact to be removed: %s", local_error->message); if (g_error_matches (local_error, E_BOOK_SDB_ERROR, @@ -1450,6 +1449,7 @@ book_backend_file_remove_contacts_sync (EBookBackend *backend, _("Contact '%s' not found"), uids[ii]); g_error_free (local_error); } else { + g_warning ("Failed to fetch contact to be removed: %s", local_error->message); g_propagate_error (error, local_error); local_error = NULL; }