GNOME Bugzilla – Bug 711403
Tidy up error handling in oFono backend
Last modified: 2013-11-06 14:40:43 UTC
Patch coming up to throw a more useful error if preparation of the oFono backend fails.
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.
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.
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.
Review of attachment 258926 [details] [review]: Looks OK.
(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(-)