Repository: incubator-atlas
Updated Branches:
  refs/heads/master 4feee3bf6 -> 3a70d11d3


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


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

Branch: refs/heads/master
Commit: 3a70d11d3c1a5d51e2c783ec28d9693b61bea71b
Parents: 4feee3b
Author: Sarath Subramanian <[email protected]>
Authored: Thu Apr 27 17:00:58 2017 -0700
Committer: Sarath Subramanian <[email protected]>
Committed: Thu Apr 27 17:00:58 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/3a70d11d/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) {

Reply via email to