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 2017/06/28 08:48:59 UTC
[1/2] syncope git commit: Better error reporting in case of AnyObject
search query without
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ò <il...@apache.org>
Authored: Wed Jun 28 10:48:42 2017 +0200
Committer: Francesco Chicchiriccò <il...@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);
[2/2] syncope git commit: Better error reporting in case of AnyObject
search query without
Posted by il...@apache.org.
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/8ae69321
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/8ae69321
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/8ae69321
Branch: refs/heads/master
Commit: 8ae693218c3f2b4575cdff943227011ae2d8e166
Parents: f09caa0
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Wed Jun 28 10:48:42 2017 +0200
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Wed Jun 28 10:48:50 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/8ae69321/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);