You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by sn...@apache.org on 2014/08/25 19:44:39 UTC

[1/2] git commit: USERGRID-63 JSON parse failure on POST should not return HTTP 500 error

Repository: incubator-usergrid
Updated Branches:
  refs/heads/master aa85022ae -> 304e8d99f


USERGRID-63 JSON parse failure on POST should not return HTTP 500 error


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

Branch: refs/heads/master
Commit: 30115d31c04df7f734ff0b8f74e70737862153a0
Parents: 7fab673
Author: Strong Liu <st...@hibernate.org>
Authored: Thu Aug 14 03:13:00 2014 +0800
Committer: Strong Liu <st...@hibernate.org>
Committed: Thu Aug 14 03:13:00 2014 +0800

----------------------------------------------------------------------
 stack/rest/pom.xml                              | 12 ++++++-
 .../exceptions/JsonParseExceptionMapper.java    | 35 ++++++++++++++++++++
 2 files changed, 46 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/30115d31/stack/rest/pom.xml
----------------------------------------------------------------------
diff --git a/stack/rest/pom.xml b/stack/rest/pom.xml
index 90311e5..fd6eeb1 100644
--- a/stack/rest/pom.xml
+++ b/stack/rest/pom.xml
@@ -478,8 +478,18 @@
       <groupId>org.slf4j</groupId>
       <artifactId>jul-to-slf4j</artifactId>
     </dependency>
+      <dependency>
+          <groupId>org.slf4j</groupId>
+          <artifactId>slf4j-log4j12</artifactId>
+      </dependency>
 
-    <!-- Testing and Logging Dependencies -->
+      <dependency>
+          <groupId>log4j</groupId>
+          <artifactId>log4j</artifactId>
+      </dependency>
+
+
+      <!-- Testing and Logging Dependencies -->
 
     <dependency>
       <groupId>org.apache.usergrid</groupId>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/30115d31/stack/rest/src/main/java/org/apache/usergrid/rest/exceptions/JsonParseExceptionMapper.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/exceptions/JsonParseExceptionMapper.java b/stack/rest/src/main/java/org/apache/usergrid/rest/exceptions/JsonParseExceptionMapper.java
new file mode 100644
index 0000000..3849573
--- /dev/null
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/exceptions/JsonParseExceptionMapper.java
@@ -0,0 +1,35 @@
+/*
+ * 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 org.codehaus.jackson.JsonParseException;
+
+import javax.ws.rs.core.Response;
+import javax.ws.rs.ext.Provider;
+
+import static javax.ws.rs.core.Response.Status.BAD_REQUEST;
+
+/**
+ * @author stliu 
+ */
+@Provider
+public class JsonParseExceptionMapper extends AbstractExceptionMapper<JsonParseException> {
+    @Override
+    public Response toResponse( JsonParseException e ) {
+        return toResponse( BAD_REQUEST, e );
+    }
+}


[2/2] git commit: Merge branch 'pr/47'

Posted by sn...@apache.org.
Merge branch 'pr/47'


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

Branch: refs/heads/master
Commit: 304e8d99fc2ca8b0d79b952248712982ad434970
Parents: aa85022 30115d3
Author: Dave Johnson <sn...@apache.org>
Authored: Mon Aug 25 13:43:47 2014 -0400
Committer: Dave Johnson <sn...@apache.org>
Committed: Mon Aug 25 13:43:47 2014 -0400

----------------------------------------------------------------------
 stack/rest/pom.xml                              | 12 ++++++-
 .../exceptions/JsonParseExceptionMapper.java    | 35 ++++++++++++++++++++
 2 files changed, 46 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/304e8d99/stack/rest/pom.xml
----------------------------------------------------------------------