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 711403 - Tidy up error handling in oFono backend
Tidy up error handling in oFono backend
Status: RESOLVED FIXED
Product: folks
Classification: Platform
Component: oFono backend
git master
Other Linux
: Normal minor
: Unset
Assigned To: folks-maint
folks-maint
Depends on:
Blocks:
 
 
Reported: 2013-11-04 13:41 UTC by Philip Withnall
Modified: 2013-11-06 14:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
core: Add a BackendError error domain for errors in Backend.prepare() (2.01 KB, patch)
2013-11-04 13:46 UTC, Philip Withnall
committed Details | Review
ofono: Throw a useful error if prepare() fails for a missing D-Bus service (2.93 KB, patch)
2013-11-04 13:46 UTC, Philip Withnall
committed Details | Review

Description Philip Withnall 2013-11-04 13:41:35 UTC
Patch coming up to throw a more useful error if preparation of the oFono backend fails.
Comment 1 Philip Withnall 2013-11-04 13:46:32 UTC
Created attachment 258925 [details] [review]
core: Add a BackendError error domain for errors in Backend.prepare()

As folks acquires more D-Bus-enabled backends, we need a common error code
for when the service can’t be started.
Comment 2 Philip Withnall 2013-11-04 13:46:35 UTC
Created attachment 258926 [details] [review]
ofono: Throw a useful error if prepare() fails for a missing D-Bus service

Previously the error was completely unhelpful.
Comment 3 Simon McVittie 2013-11-06 11:55:16 UTC
Review of attachment 258925 [details] [review]:

::: folks/backend.vala
@@ +36,3 @@
+   * @since UNRELEASED
+   */
+  NO_DBUS_SERVICE

Not G_DBUS_ERROR_NAME_HAS_NO_OWNER or G_DBUS_ERROR_SERVICE_UNKNOWN? But if you'd prefer to have a Folks-specific domain rather than recycling GIO's, this looks OK.
Comment 4 Simon McVittie 2013-11-06 12:27:48 UTC
Review of attachment 258926 [details] [review]:

Looks OK.
Comment 5 Philip Withnall 2013-11-06 14:38:51 UTC
(In reply to comment #3)
> Review of attachment 258925 [details] [review]:
> 
> ::: folks/backend.vala
> @@ +36,3 @@
> +   * @since UNRELEASED
> +   */
> +  NO_DBUS_SERVICE
> 
> Not G_DBUS_ERROR_NAME_HAS_NO_OWNER or G_DBUS_ERROR_SERVICE_UNKNOWN? But if
> you'd prefer to have a Folks-specific domain rather than recycling GIO's, this
> looks OK.

Good point. Reworked it to use G_DBUS_ERROR_SERVICE_UNKNOWN. Thanks!

commit 5248f654d5f74b1565f485769cfc5108f2cacaa9
Author: Philip Withnall <philip.withnall@collabora.co.uk>
Date:   Mon Nov 4 13:42:41 2013 +0000

    ofono: Throw a useful error if prepare() fails for a missing D-Bus service
    
    Previously the error was completely unhelpful.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=711403

 backends/ofono/ofono-backend.vala | 26 ++++++++++++++++++--------
 po/POTFILES.in                    |  1 +
 po/POTFILES.skip                  |  1 +
 3 files changed, 20 insertions(+), 8 deletions(-)

commit e49a256f89e49b1a08f04c19336bd0b18f2fe125
Author: Philip Withnall <philip.withnall@collabora.co.uk>
Date:   Mon Nov 4 13:41:59 2013 +0000

    core: Bless DBusError.SERVICE_UNKNOWN for D-Bus service problems on prepare()
    
    As folks acquires more D-Bus-enabled backends, we need a common error code
    for when the service can’t be started. In the Backend.prepare() documentation,
    bless DBusError.SERVICE_UNKNOWN as this error code.
    
    Also fix the BlueZ backend to emit it instead of a custom error code.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=711403

 backends/bluez/bluez-backend.vala | 21 +++------------------
 folks/backend.vala                |  2 ++
 2 files changed, 5 insertions(+), 18 deletions(-)