From 03d626856b294bc98919ac244e04e9b8821a681d Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 9 Jul 2010 14:29:51 +0200 Subject: Bug #623204 - Be able to report detailed errors from backends --- mail/em-utils.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'mail') diff --git a/mail/em-utils.c b/mail/em-utils.c index aa147bf7e1..e182e61364 100644 --- a/mail/em-utils.c +++ b/mail/em-utils.c @@ -1565,18 +1565,18 @@ struct TryOpenEBookStruct { }; static void -try_open_e_book_cb (EBook *book, EBookStatus status, gpointer closure) +try_open_e_book_cb (EBook *book, const GError *error, gpointer closure) { struct TryOpenEBookStruct *data = (struct TryOpenEBookStruct *)closure; if (!data) return; - data->result = status == E_BOOK_ERROR_OK; + data->result = error == NULL; if (!data->result) { g_clear_error (data->error); - g_set_error (data->error, E_BOOK_ERROR, status, "EBookStatus returned %d", status); + g_propagate_error (data->error, g_error_copy (error)); } e_flag_set (data->flag); @@ -1600,10 +1600,10 @@ try_open_e_book (EBook *book, gboolean only_if_exists, GError **error) data.flag = flag; data.result = FALSE; - if (e_book_async_open (book, only_if_exists, try_open_e_book_cb, &data) != FALSE) { + if (!e_book_async_open_ex (book, only_if_exists, try_open_e_book_cb, &data)) { e_flag_free (flag); g_clear_error (error); - g_set_error (error, E_BOOK_ERROR, E_BOOK_ERROR_OTHER_ERROR, "Failed to call e_book_async_open."); + g_set_error (error, E_BOOK_ERROR, E_BOOK_ERROR_OTHER_ERROR, "Failed to call e_book_async_open_ex."); return FALSE; } -- cgit v1.2.3