syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [1/2] syncope git commit: Better error reporting in case of AnyObject search query without
Date Wed, 28 Jun 2017 08:48:59 GMT
Repository: syncope
Updated Branches:
  refs/heads/2_0_X 11a428cfb -> d87f829d6
  refs/heads/master f09caa082 -> 8ae693218


Better error reporting in case of AnyObject search query without


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/d87f829d
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/d87f829d
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/d87f829d

Branch: refs/heads/2_0_X
Commit: d87f829d6e8b6073884a3da096f89906a7608b85
Parents: 11a428c
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Wed Jun 28 10:48:42 2017 +0200
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Wed Jun 28 10:48:42 2017 +0200

----------------------------------------------------------------------
 .../syncope/core/rest/cxf/service/AnyObjectServiceImpl.java   | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/d87f829d/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/AnyObjectServiceImpl.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/AnyObjectServiceImpl.java
b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/AnyObjectServiceImpl.java
index c5ae33e..ba7334b 100644
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/AnyObjectServiceImpl.java
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/AnyObjectServiceImpl.java
@@ -18,12 +18,13 @@
  */
 package org.apache.syncope.core.rest.cxf.service;
 
-import javax.ws.rs.BadRequestException;
 import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.common.lib.SyncopeClientException;
 import org.apache.syncope.common.lib.patch.AnyObjectPatch;
 import org.apache.syncope.common.lib.search.SpecialAttr;
 import org.apache.syncope.common.lib.to.AnyObjectTO;
 import org.apache.syncope.common.lib.to.PagedResult;
+import org.apache.syncope.common.lib.types.ClientExceptionType;
 import org.apache.syncope.common.rest.api.beans.AnyQuery;
 import org.apache.syncope.common.rest.api.service.AnyObjectService;
 import org.apache.syncope.core.logic.AbstractAnyLogic;
@@ -54,7 +55,9 @@ public class AnyObjectServiceImpl extends AbstractAnyService<AnyObjectTO,
AnyObj
         if (StringUtils.isBlank(anyQuery.getFiql())
                 || -1 == anyQuery.getFiql().indexOf(SpecialAttr.TYPE.toString())) {
 
-            throw new BadRequestException(SpecialAttr.TYPE.toString() + " is required in
the FIQL string");
+            SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.InvalidSearchExpression);
+            sce.getElements().add(SpecialAttr.TYPE.toString() + " is required in the FIQL
string");
+            throw sce;
         }
 
         return super.search(anyQuery);


Mime
View raw message