aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEmil Ivov <emcho@jitsi.org>2006-09-27 09:37:49 +0000
committerEmil Ivov <emcho@jitsi.org>2006-09-27 09:37:49 +0000
commitf80fb1daccea8ad6af44566e9195e2a1c2499781 (patch)
treef1a42d8322b43bf98af09a0bf33d6a18d9828794 /src
parentde24763b93c52d700feadebdcbd167129848b4a5 (diff)
downloadjitsi-f80fb1daccea8ad6af44566e9195e2a1c2499781.zip
jitsi-f80fb1daccea8ad6af44566e9195e2a1c2499781.tar.gz
jitsi-f80fb1daccea8ad6af44566e9195e2a1c2499781.tar.bz2
when we try to add a conact that's already in the list, throw the corresponding exception
Diffstat (limited to 'src')
-rw-r--r--src/net/java/sip/communicator/impl/contactlist/MetaContactListServiceImpl.java11
-rw-r--r--src/net/java/sip/communicator/service/contactlist/MetaContactListException.java9
2 files changed, 19 insertions, 1 deletions
diff --git a/src/net/java/sip/communicator/impl/contactlist/MetaContactListServiceImpl.java b/src/net/java/sip/communicator/impl/contactlist/MetaContactListServiceImpl.java
index dc82d64..80c7ade 100644
--- a/src/net/java/sip/communicator/impl/contactlist/MetaContactListServiceImpl.java
+++ b/src/net/java/sip/communicator/impl/contactlist/MetaContactListServiceImpl.java
@@ -333,6 +333,17 @@ public class MetaContactListServiceImpl
//wait for a confirmation event
evtRetriever.waitForEvent(CONTACT_LIST_MODIFICATION_TIMEOUT);
}
+ catch(OperationFailedException ex)
+ {
+ if(ex.getErrorCode()
+ == OperationFailedException.SUBSCRIPTION_ALREADY_EXISTS)
+ {
+ throw new MetaContactListException(
+ "failed to create contact" + contactID
+ , ex
+ , MetaContactListException.CODE_CONTACT_ALREADY_EXISTS_ERROR);
+ }
+ }
catch (Exception ex)
{
throw new MetaContactListException(
diff --git a/src/net/java/sip/communicator/service/contactlist/MetaContactListException.java b/src/net/java/sip/communicator/service/contactlist/MetaContactListException.java
index aaf4bf9..fb0440e 100644
--- a/src/net/java/sip/communicator/service/contactlist/MetaContactListException.java
+++ b/src/net/java/sip/communicator/service/contactlist/MetaContactListException.java
@@ -30,10 +30,17 @@ public class MetaContactListException
public static final int CODE_NETWORK_ERROR = 2;
/**
+ * Indicates that the exception was caused by the fact that we tried to
+ * add to our contact list a contact that was already in there.
+ */
+ public static final int CODE_CONTACT_ALREADY_EXISTS_ERROR = 3;
+
+
+ /**
* Indicates that the error which caused the exception was either unknown
* or did not correspond to any of the other error codes
*/
- public static final int CODE_UNKNOWN_ERROR = 3;
+ public static final int CODE_UNKNOWN_ERROR = 4;
/**
* An error code indicating the nature of this excepiton.