usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mru...@apache.org
Subject [13/16] usergrid git commit: return 400 when direct query has too many items
Date Tue, 23 Oct 2018 03:17:51 GMT
return 400 when direct query has too many items


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

Branch: refs/heads/master
Commit: 0a3333c90b9beb00037f83af9cd49044a83618d5
Parents: 98a2f5d
Author: Mike Dunker <mdunker@google.com>
Authored: Thu Apr 12 18:27:31 2018 -0700
Committer: Keyur Karnik <keyur.karnik+github@gmail.com>
Committed: Tue Aug 28 16:48:05 2018 -0700

----------------------------------------------------------------------
 .../TooManyDirectEntitiesExceptionMapper.java        | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/0a3333c9/stack/rest/src/main/java/org/apache/usergrid/rest/exceptions/TooManyDirectEntitiesExceptionMapper.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/exceptions/TooManyDirectEntitiesExceptionMapper.java
b/stack/rest/src/main/java/org/apache/usergrid/rest/exceptions/TooManyDirectEntitiesExceptionMapper.java
new file mode 100644
index 0000000..843086d
--- /dev/null
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/exceptions/TooManyDirectEntitiesExceptionMapper.java
@@ -0,0 +1,15 @@
+package org.apache.usergrid.rest.exceptions;
+
+
+import javax.ws.rs.core.Response;
+import javax.ws.rs.ext.Provider;
+import static javax.ws.rs.core.Response.Status.BAD_REQUEST;
+import org.apache.usergrid.persistence.index.exceptions.TooManyDirectEntitiesException;
+
+@Provider
+public class TooManyDirectEntitiesExceptionMapper extends AbstractExceptionMapper<TooManyDirectEntitiesException>
{
+    @Override
+    public Response toResponse( final TooManyDirectEntitiesException e ) {
+        return toResponse( BAD_REQUEST, e );
+    }
+}


Mime
View raw message