[folks] eds/tracker: Ensure the PersonaStores are removed on error
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [folks] eds/tracker: Ensure the PersonaStores are removed on error
- Date: Fri, 2 Sep 2011 20:34:03 +0000 (UTC)
commit 823a6ae6b8bb63dbd50e5fae56793a20b1ee2d34
Author: Philip Withnall <philip tecnocode co uk>
Date: Fri Sep 2 21:15:08 2011 +0100
eds/tracker: Ensure the PersonaStores are removed on error
backends/eds/lib/edsf-persona-store.vala | 12 ++++++++++++
backends/tracker/lib/trf-persona-store.vala | 3 +++
2 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/backends/eds/lib/edsf-persona-store.vala b/backends/eds/lib/edsf-persona-store.vala
index e256740..83e0c29 100644
--- a/backends/eds/lib/edsf-persona-store.vala
+++ b/backends/eds/lib/edsf-persona-store.vala
@@ -505,6 +505,9 @@ public class Edsf.PersonaStore : Folks.PersonaStore
}
catch (GLib.Error e1)
{
+ /* Remove the persona store on error */
+ this.removed ();
+
if (e1.domain == BookClient.error_quark ())
{
switch ((BookClientError) e1.code)
@@ -572,6 +575,9 @@ public class Edsf.PersonaStore : Folks.PersonaStore
if (this._addressbook.is_opened () == false)
{
+ /* Remove the persona store on error */
+ this.removed ();
+
throw new PersonaStoreError.INVALID_ARGUMENT (
/* Translators: the parameter is an address book URI. */
_("Couldn't open address book â%sâ."), this.id);
@@ -596,6 +602,9 @@ public class Edsf.PersonaStore : Folks.PersonaStore
}
catch (GLib.Error e2)
{
+ /* Remove the persona store on error */
+ this.removed ();
+
throw new PersonaStoreError.INVALID_ARGUMENT (
/* Translators: the parameteter is an error message. */
_("Couldn't get address book capabilities: %s"), e2.message);
@@ -623,6 +632,9 @@ public class Edsf.PersonaStore : Folks.PersonaStore
}
catch (GLib.Error e3)
{
+ /* Remove the persona store on error */
+ this.removed ();
+
if (e3.domain == BookClient.error_quark ())
{
switch ((BookClientError) e3.code)
diff --git a/backends/tracker/lib/trf-persona-store.vala b/backends/tracker/lib/trf-persona-store.vala
index 3d44425..598b9a2 100644
--- a/backends/tracker/lib/trf-persona-store.vala
+++ b/backends/tracker/lib/trf-persona-store.vala
@@ -1076,18 +1076,21 @@ public class Trf.PersonaStore : Folks.PersonaStore
{
warning ("Could not connect to D-Bus service: %s",
e1.message);
+ this.removed ();
throw new PersonaStoreError.INVALID_ARGUMENT (e1.message);
}
catch (Tracker.Sparql.Error e2)
{
warning ("Error fetching SPARQL connection handler: %s",
e2.message);
+ this.removed ();
throw new PersonaStoreError.INVALID_ARGUMENT (e2.message);
}
catch (GLib.DBusError e3)
{
warning ("Could not connect to D-Bus service: %s",
e3.message);
+ this.removed ();
throw new PersonaStoreError.INVALID_ARGUMENT (e3.message);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]