After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 623204 - Be able to report detailed errors from backends
Be able to report detailed errors from backends
Status: RESOLVED FIXED
Product: evolution-data-server
Classification: Platform
Component: general
2.32.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: Milan Crha
Evolution QA team
evolution[gnome3]
Depends on:
Blocks:
 
 
Reported: 2010-06-30 12:10 UTC by Milan Crha
Modified: 2013-09-14 16:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed eds patch (632.82 KB, patch)
2010-07-07 21:55 UTC, Milan Crha
committed Details | Review
proposed evo patch (105.54 KB, patch)
2010-07-07 22:00 UTC, Milan Crha
committed Details | Review
proposed eex patch (138.00 KB, patch)
2010-07-07 22:02 UTC, Milan Crha
committed Details | Review
proposed ema patch (75.76 KB, patch)
2010-07-08 10:59 UTC, Milan Crha
committed Details | Review
proposed ecd patch (32.48 KB, patch)
2010-07-09 13:26 UTC, Milan Crha
none Details | Review

Description Milan Crha 2010-06-30 12:10:42 UTC
It might be a good time to change backend's API for calendar and addressbook to be able to report detailed information about an error from an operation, because it's quite bad to see only "Other error" in Evolution, even the backend itself does know what was going wrong (usually). Of course, the other standard errors are better to be kept as they are, to not have same string spread all around the sources (thus some common function for error creation would work pretty well).
Comment 1 Chenthill P 2010-07-01 06:41:53 UTC
I am for it. This is going to be very useful for serving the custom error messages which emanate from the server side more often. With dbus since its possible to send GError we can do these cleanups.. Heads-up in e-h list while getting this done would be better to incorporate any suggestions and inform the external backend developers about the change.
Comment 2 Milan Crha 2010-07-07 21:55:04 UTC
Created attachment 165442 [details] [review]
proposed eds patch

for evolution-data-server;

As spoken on the evolution-hackers and on IRC, I left there the old API of ECal/EBook under E_CAL_DISABLE_DEPRECATED/E_BOOK_DISABLE_DEPRECATED defines, so one can get rid of the deprecated stuff by defining these.

To summarize changes:
- EBookBackendSyncStatus/ECalBackendSyncStatus dropped, replaced with GError
- All hacks with GNOME_Evolution_Addressbook_*/GNOME_Evolution_Calendar_ replaced with their real values.
- E_BOOK_ERROR_CORBA_EXCEPTION renamed to E_BOOK_ERROR_DBUS_EXCEPTION
- E_BOOK_ERROR_NOT_SUPPORTED added, to return result of the function as not being
supported by the backend
- EBookView's "sequence_complete" signal is now deprecated, replaced by "view_complete" signal, which is using an EBookViewStatus and a message string
- e_book_async_* is deprecated by its e_book_async_*_ex version, which is using async callbacks with GError instead of a status only
- addressbook/libedata-book/e-data-book-marshal.list file added
- EDataBookView's "Complete" signal signature changed, the error_msg had been added
- ECalView's "view_done" signal is deprecated, and is replaced by "view_complete" signal, which has also an error_msg, instead of an error code only
- e_cal_view_stop function had been added + necessary functions in EDataCalView to know about stopped views
- ECal's "cal_opened" signal is deprecated, replaced by "cal_opened_ex", which has a GError as an argument
- E_CALENDAR_STATUS_CORBA_EXCEPTION renamed to E_CALENDAR_STATUS_DBUS_EXCEPTION
- E_CALENDAR_STATUS_NOT_SUPPORTED code added
- e_load_book_source is deprecated, replaced by e_load_book_source_ex

I kept there e_cal_backend_notify_error without any change.
Comment 3 Milan Crha 2010-07-07 22:00:25 UTC
Created attachment 165443 [details] [review]
proposed evo patch

for evolution;

Adapt to the changes. Everything works, just ECalModel seems to be publicly available, so I deprecated "cal_view_done" signal and defined "cal_view_complete" signal. This wasn't necessary for addressbooks, because that is not public, so I just changed it. If you think it should be just changed too, then let me know.
Comment 4 Milan Crha 2010-07-07 22:02:32 UTC
Created attachment 165444 [details] [review]
proposed eex patch

for evolution-exchange;

Pretty straightforward change to backends.

ema lefts, I'll do it tomorrow (Thursday).
Comment 5 Milan Crha 2010-07-08 10:59:11 UTC
Created attachment 165465 [details] [review]
proposed ema patch

for evolution-mapi;

ema bits, just modify backends appropriately.
Comment 6 Milan Crha 2010-07-08 11:00:52 UTC
I realized there are some places where I call g_propagate_error with the second parameter NULL, in eds.patch, so I shouldn't forget to fix this before committing.
Comment 7 Chenthill P 2010-07-09 10:58:49 UTC
Looked through all the .h file changes and they are fine to go ahead for the commit. Nice work!!
Comment 8 Milan Crha 2010-07-09 12:34:41 UTC
Created commit 0dbb2c2 in eds master (2.31.5+)
Created commit 03d6268 in evo master (2.31.5+)
Created commit e201a9a in eex master (2.31.5+)
Created commit 9e81059 in ema master (0.31.5+)
Comment 9 Milan Crha 2010-07-09 13:26:22 UTC
Created attachment 165556 [details] [review]
proposed ecd patch

for evolution-couchdb;

As the calendar part is disabled at the moment, I just blindly done changes there. The addressbook part is compiled without any issue reported by a compiler. I do not have CouchDB on my machine, thus this is untested, only by compiler. Please let me know if you are in doubt.
Comment 10 Milan Crha 2010-07-09 14:21:01 UTC
Also updated user documentation in eds commit 8ac7084.
Comment 11 Rob Bradford 2010-08-01 08:58:39 UTC
Hey Milan, love the fact that you can now get errors from the backends. Woot! My only concern is that this _ex suffix makes the API look a bit ugly :-/

What about changing the position of the "async" part...

e.g. e_book_open_async rather than e_book_async_open_ex compared to e_book_async_open (old)
Comment 12 Rob Bradford 2010-08-01 15:54:37 UTC
Milan, I create a bug report with these changes attached: https://bugzilla.gnome.org/show_bug.cgi?id=625752

It's also in the rbradford-async-rename branch