You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2015/01/23 17:41:26 UTC

[04/15] syncope git commit: FIT server integration tests

http://git-wip-us.apache.org/repos/asf/syncope/blob/80589a1b/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/RestServiceExceptionMapper.java
----------------------------------------------------------------------
diff --git a/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/RestServiceExceptionMapper.java b/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/RestServiceExceptionMapper.java
index 19a4a0d..fc78a54 100644
--- a/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/RestServiceExceptionMapper.java
+++ b/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/RestServiceExceptionMapper.java
@@ -45,6 +45,7 @@ import org.apache.syncope.common.rest.api.RESTHeaders;
 import org.apache.syncope.server.misc.security.UnauthorizedRoleException;
 import org.apache.syncope.server.persistence.api.attrvalue.validation.InvalidEntityException;
 import org.apache.syncope.server.persistence.api.attrvalue.validation.ParsingValidationException;
+import org.apache.syncope.server.persistence.api.dao.DuplicateException;
 import org.apache.syncope.server.persistence.api.dao.NotFoundException;
 import org.apache.syncope.server.workflow.api.WorkflowException;
 import org.identityconnectors.framework.common.exceptions.ConfigurationException;
@@ -89,7 +90,7 @@ public class RestServiceExceptionMapper implements ExceptionMapper<Exception>, R
                     header(HttpHeaders.WWW_AUTHENTICATE, BASIC_REALM_UNAUTHORIZED);
         } else if (ex instanceof UnauthorizedRoleException) {
             builder = builder(Response.Status.UNAUTHORIZED, ClientExceptionType.UnauthorizedRole, getExMessage(ex));
-        } else if (ex instanceof EntityExistsException) {
+        } else if (ex instanceof EntityExistsException || ex instanceof DuplicateException) {
             builder = builder(Response.Status.CONFLICT, ClientExceptionType.EntityExists, getExMessage(ex));
         } else if (ex instanceof DataIntegrityViolationException) {
             builder = builder(Response.Status.CONFLICT, ClientExceptionType.DataIntegrityViolation, getExMessage(ex));