Commit 5ee49fde by Sarath Subramanian

ATLAS-3373: Regression : Creating an entity with unknown type throws 500 ,…

ATLAS-3373: Regression : Creating an entity with unknown type throws 500 , expected is 400 bad request
parent 921f487b
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment