Distinguish Telepathy errors with new UNSUPPORTED_ON_NON_USER
authorTravis Reitter <travis.reitter@collabora.co.uk>
Mon, 10 Oct 2011 18:07:01 +0000 (11:07 -0700)
committerTravis Reitter <travis.reitter@collabora.co.uk>
Tue, 11 Oct 2011 01:13:17 +0000 (18:13 -0700)
NEWS
backends/telepathy/lib/tpf-persona-store.vala
folks/persona-store.vala

diff --git a/NEWS b/NEWS
index c0d5756..79cdc36 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,7 @@ API changes:
 * Implement EmailDetails on Tpf.Persona
 * Implement UrlDetails on Tpf.Persona
 * Implement BirthdayDetails on Tpf.Persona
+* Add PersonaStoreError.UNSUPPORTED_ON_NON_USER
 
 Overview of changes from libfolks 0.6.3.1 to libfolks 0.6.3.2
 =============================================================
index 9dec990..560e402 100644 (file)
@@ -2250,7 +2250,7 @@ public class Tpf.PersonaStore : Folks.PersonaStore
     {
       if (!persona.is_user)
         {
-          throw new PersonaStoreError.INVALID_ARGUMENT (
+          throw new PersonaStoreError.UNSUPPORTED_ON_NON_USER (
               _("Extended information may only be set on the user's Telepathy contact."));
         }
 
index aa533c1..3b4c3e0 100644 (file)
@@ -115,6 +115,14 @@ public errordomain Folks.PersonaStoreError
    * @since 0.6.0
    */
   REMOVE_FAILED,
+
+  /**
+   * Such an operation may only be performed on a {@link Persona} with
+   * {@link Persona.is_user} set to `true`.
+   *
+   * @since UNRELEASED
+   */
+  UNSUPPORTED_ON_NON_USER,
 }
 
 /**