atlas-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sar...@apache.org
Subject incubator-atlas git commit: ATLAS-1611: Regression: Incorrect error code for the negative tests, returned: 500 server error, expected: 400 bad request
Date Fri, 28 Apr 2017 00:02:19 GMT
Repository: incubator-atlas
Updated Branches:
  refs/heads/0.8-incubating dacd61d40 -> 97b71e8be


ATLAS-1611: Regression: Incorrect error code for the negative tests, returned: 500 server
error, expected: 400 bad request

(cherry picked from commit 3a70d11d3c1a5d51e2c783ec28d9693b61bea71b)


Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/97b71e8b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/97b71e8b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/97b71e8b

Branch: refs/heads/0.8-incubating
Commit: 97b71e8bec6024355026b4c1e052739350d13d8a
Parents: dacd61d
Author: Sarath Subramanian <ssubramanian@hortonworks.com>
Authored: Thu Apr 27 17:00:58 2017 -0700
Committer: Sarath Subramanian <ssubramanian@hortonworks.com>
Committed: Thu Apr 27 17:02:06 2017 -0700

----------------------------------------------------------------------
 .../org/apache/atlas/web/resources/EntityResource.java    | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/97b71e8b/webapp/src/main/java/org/apache/atlas/web/resources/EntityResource.java
----------------------------------------------------------------------
diff --git a/webapp/src/main/java/org/apache/atlas/web/resources/EntityResource.java b/webapp/src/main/java/org/apache/atlas/web/resources/EntityResource.java
index 8328da5..19c5594 100755
--- a/webapp/src/main/java/org/apache/atlas/web/resources/EntityResource.java
+++ b/webapp/src/main/java/org/apache/atlas/web/resources/EntityResource.java
@@ -1190,8 +1190,14 @@ public class EntityResource {
         return jsonArray;
     }
 
-    private AtlasEntityType getEntityType(String typeName) {
-        return typeRegistry.getEntityTypeByName(typeName);
+    private AtlasEntityType getEntityType(String typeName) throws AtlasBaseException {
+        AtlasEntityType ret = typeRegistry.getEntityTypeByName(typeName);
+
+        if (ret == null) {
+            throw new AtlasBaseException(AtlasErrorCode.TYPE_NAME_NOT_FOUND, typeName);
+        }
+
+        return ret;
     }
 
     public static WebApplicationException toWebApplicationException(AtlasBaseException e)
{


Mime
View raw message