You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by gr...@apache.org on 2015/07/24 17:24:27 UTC

[2/2] incubator-usergrid git commit: Added properly named file

Added properly named file


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

Branch: refs/heads/USERGRID-869
Commit: 1fe4fe7b312ab8a07dcc66444fa1bcaf042f9bdc
Parents: 905b781
Author: GERey <gr...@apigee.com>
Authored: Fri Jul 24 08:24:24 2015 -0700
Committer: GERey <gr...@apigee.com>
Committed: Fri Jul 24 08:24:24 2015 -0700

----------------------------------------------------------------------
 .../AwsPropertiesNotFoundExceptionMapper.java   | 37 ++++++++++++++++++++
 1 file changed, 37 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1fe4fe7b/stack/rest/src/main/java/org/apache/usergrid/rest/exceptions/AwsPropertiesNotFoundExceptionMapper.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/exceptions/AwsPropertiesNotFoundExceptionMapper.java b/stack/rest/src/main/java/org/apache/usergrid/rest/exceptions/AwsPropertiesNotFoundExceptionMapper.java
new file mode 100644
index 0000000..f0f6e97
--- /dev/null
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/exceptions/AwsPropertiesNotFoundExceptionMapper.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.usergrid.rest.exceptions;
+
+
+import javax.ws.rs.core.Response;
+
+import org.apache.usergrid.services.exceptions.AwsPropertiesNotFoundException;
+
+import static javax.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR;
+import static javax.ws.rs.core.Response.Status.NOT_FOUND;
+
+
+/**
+ * Maps the AwsPropertiesNotFoundExceptionMapper to a 500 error due to having a legit response
+ * but there is an error in the properties file.
+ */
+public class AwsPropertiesNotFoundExceptionMapper extends AbstractExceptionMapper<AwsPropertiesNotFoundException> {
+    @Override
+    public Response toResponse( AwsPropertiesNotFoundException e ) {
+        return toResponse( INTERNAL_SERVER_ERROR, e );
+    }
+}