diff --git a/intg/src/main/java/org/apache/atlas/AtlasErrorCode.java b/intg/src/main/java/org/apache/atlas/AtlasErrorCode.java index aa79ad5d1bf..ca7220243ab 100644 --- a/intg/src/main/java/org/apache/atlas/AtlasErrorCode.java +++ b/intg/src/main/java/org/apache/atlas/AtlasErrorCode.java @@ -210,7 +210,6 @@ public enum AtlasErrorCode { NO_TYPE_NAME_ON_VERTEX(404, "ATLAS-404-00-015", "No typename found for given entity with guid: {0}"), NO_LINEAGE_CONSTRAINTS_FOR_GUID(404, "ATLAS-404-00-016", "No lineage constraints found for requested entity with guid : {0}"), IMPORT_NOT_FOUND(404, "ATLAS-404-00-017", "Import id {0} is not found"), - RELATIONSHIP_LABEL_NOT_FOUND(404, "ATLAS-404-00-018", "No edges found with relationship label ''{0}'' on entity {1} (guid: {2}). Either the relationship does not exist or the entity has no relationships of this type."), METHOD_NOT_ALLOWED(405, "ATLAS-405-00-001", "Error 405 - The request method {0} is inappropriate for the URL: {1}"), diff --git a/repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java b/repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java index 3f845019d20..ae0ccc1bc51 100644 --- a/repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java +++ b/repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java @@ -98,6 +98,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; +import java.util.Collections; import java.util.Date; import java.util.HashMap; import java.util.HashSet; @@ -566,7 +567,11 @@ public AtlasSearchResult searchRelatedEntities(String guid, String relation, boo if (endEntityType == null) { if (StringUtils.isEmpty(endEntityTypeName)) { // No edges with this label exist on the entity - throw new AtlasBaseException(AtlasErrorCode.RELATIONSHIP_LABEL_NOT_FOUND, relation, entityTypeName, guid); + LOG.warn("No edges found for relation '{}' on entity '{}' (guid={}), returning empty result", + relation, entityTypeName, guid); + ret.setEntities(Collections.emptyList()); + ret.setApproximateCount(0L); + return ret; } else { // Edges exist but entity type not in registry throw new AtlasBaseException(AtlasErrorCode.INVALID_RELATIONSHIP_LABEL, relation, endEntityTypeName);