This is an automated email from the ASF dual-hosted git repository.
sarath pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/atlas.git
The following commit(s) were added to refs/heads/branch-2.0 by this push:
new ab34822 ATLAS-3373: Regression : Creating an entity with unknown type
throws 500 , expected is 400 bad request
ab34822 is described below
commit ab34822264b7da7ad6ad092dd7f655d57b47ac0e
Author: Sarath Subramanian <[email protected]>
AuthorDate: Wed Aug 14 12:01:49 2019 -0700
ATLAS-3373: Regression : Creating an entity with unknown type throws 500 ,
expected is 400 bad request
(cherry picked from commit 5ee49fde2a1ec31e587c2123b823e3464bbada5e)
---
.../atlas/repository/store/graph/v2/AtlasEntityGraphDiscoveryV2.java | 4 ++++
1 file changed, 4 insertions(+)
diff --git
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityGraphDiscoveryV2.java
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityGraphDiscoveryV2.java
index 84bb2a3..44df351 100644
---
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityGraphDiscoveryV2.java
+++
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityGraphDiscoveryV2.java
@@ -402,6 +402,10 @@ public class AtlasEntityGraphDiscoveryV2 implements
EntityGraphDiscovery {
private void processDynamicAttributes(AtlasEntity entity) throws
AtlasBaseException {
AtlasEntityType entityType =
typeRegistry.getEntityTypeByName(entity.getTypeName());
+ if (entityType == null) {
+ throw new AtlasBaseException(AtlasErrorCode.TYPE_NAME_INVALID,
TypeCategory.ENTITY.name(), entity.getTypeName());
+ }
+
for (AtlasAttribute attribute : entityType.getDynEvalAttributes()) {
String attributeName = attribute.getName();
List<TemplateToken> tokens =
entityType.getParsedTemplates().get(attributeName);