usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject usergrid git commit: ElasticsearchException added so we return 503's if we don't do GETs.
Date Wed, 20 Jan 2016 23:08:19 GMT
Repository: usergrid
Updated Branches:
  refs/heads/USERGRID-1051 [created] 78bc3d5c0


ElasticsearchException added so we return 503's if we don't do GETs.


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

Branch: refs/heads/USERGRID-1051
Commit: 78bc3d5c06c25e2a2e7280e9d87e87f169b328b7
Parents: a51ee2c
Author: George Reyes <grey@apache.org>
Authored: Wed Jan 20 15:02:20 2016 -0800
Committer: George Reyes <grey@apache.org>
Committed: Wed Jan 20 15:02:20 2016 -0800

----------------------------------------------------------------------
 .../ElasticsearchExecutionExceptionMapper.java  | 24 ++++++++++++++++++++
 1 file changed, 24 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/78bc3d5c/stack/rest/src/main/java/org/apache/usergrid/rest/exceptions/ElasticsearchExecutionExceptionMapper.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/exceptions/ElasticsearchExecutionExceptionMapper.java
b/stack/rest/src/main/java/org/apache/usergrid/rest/exceptions/ElasticsearchExecutionExceptionMapper.java
new file mode 100644
index 0000000..6636727
--- /dev/null
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/exceptions/ElasticsearchExecutionExceptionMapper.java
@@ -0,0 +1,24 @@
+package org.apache.usergrid.rest.exceptions;
+
+
+import javax.ws.rs.core.Response;
+import javax.ws.rs.ext.Provider;
+
+import org.elasticsearch.action.search.SearchPhaseExecutionException;
+
+import static javax.ws.rs.core.Response.Status.SERVICE_UNAVAILABLE;
+
+
+/**
+ * Created by ApigeeCorporation on 1/19/16.
+ */
+@Provider
+public class ElasticsearchExecutionExceptionMapper
+    extends AbstractExceptionMapper<SearchPhaseExecutionException>  {
+
+    @Override
+    public Response toResponse( SearchPhaseExecutionException spee ){
+        return toResponse( SERVICE_UNAVAILABLE, spee );
+
+    }
+}


Mime
View raw message