diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/SoftDeleteHandlerV1.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/SoftDeleteHandlerV1.java index d408a2cd05..ed103e2402 100644 --- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/SoftDeleteHandlerV1.java +++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/SoftDeleteHandlerV1.java @@ -18,6 +18,7 @@ package org.apache.atlas.repository.store.graph.v1; +import org.apache.atlas.AtlasErrorCode; import org.apache.atlas.RequestContext; import org.apache.atlas.exception.AtlasBaseException; import org.apache.atlas.model.instance.AtlasEntity.Status; @@ -96,9 +97,13 @@ protected void deleteEdge(AtlasEdge edge, boolean force) throws AtlasBaseExcepti } if (isRelationshipEdge) AtlasRelationshipStoreV2.recordRelationshipMutation(AtlasRelationshipStoreV2.RelationshipMutation.RELATIONSHIP_SOFT_DELETE, edge, entityRetriever); + } catch (NullPointerException npe) { + LOG.error("Error while deleting edge {}", GraphHelper.string(edge), npe); + throw new AtlasBaseException(AtlasErrorCode.UNKNOWN_SERVER_ERROR, npe); } catch (Exception e) { LOG.error("Error while deleting edge {}", GraphHelper.string(edge), e); throw new AtlasBaseException(e); } + } } diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphRetriever.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphRetriever.java index 390036d477..9124dbcf45 100644 --- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphRetriever.java +++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphRetriever.java @@ -1044,11 +1044,6 @@ private AtlasEntityHeader mapVertexToAtlasEntityHeader(AtlasVertex entityVertex, } } } - catch (NullPointerException npe) { - String id = entityVertex.getIdForDisplay()==null ? "null" :entityVertex.getIdForDisplay(); - LOG.error("mapVertexToAtlasEntityHeader: failed for entityVertex with id {}", id, npe); - throw new AtlasBaseException(AtlasErrorCode.UNKNOWN_SERVER_ERROR, npe, "mapVertexToAtlasEntityHeader: failed for entityVertex with id " + id); - } finally { RequestContext.get().endMetricRecord(metricRecorder); }