From 35af5eda52d4eaba9d0212d96a4c8f3dbf4603ce Mon Sep 17 00:00:00 2001 From: Suman Das <59254445+sumandas0@users.noreply.github.com> Date: Wed, 31 Jan 2024 12:07:11 +0530 Subject: [PATCH 1/2] re: refactor the error type --- .../repository/store/graph/v2/EntityGraphRetriever.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 b5f5c3425d..18111068f7 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 @@ -121,7 +121,6 @@ import static org.apache.atlas.repository.graph.GraphHelper.*; import static org.apache.atlas.repository.store.graph.v2.AtlasGraphUtilsV2.getIdFromVertex; import static org.apache.atlas.repository.store.graph.v2.AtlasGraphUtilsV2.isReference; -import static org.apache.atlas.repository.store.graph.v2.tasks.ClassificationPropagateTaskFactory.CLASSIFICATION_ONLY_PROPAGATION_DELETE; import static org.apache.atlas.type.AtlasStructType.AtlasAttribute.AtlasRelationshipEdgeDirection; import static org.apache.atlas.type.AtlasStructType.AtlasAttribute.AtlasRelationshipEdgeDirection.BOTH; import static org.apache.atlas.type.AtlasStructType.AtlasAttribute.AtlasRelationshipEdgeDirection.IN; @@ -1045,9 +1044,10 @@ private AtlasEntityHeader mapVertexToAtlasEntityHeader(AtlasVertex entityVertex, } } } - catch (NullPointerException npe){ - LOG.error("mapVertexToAtlasEntityHeader: failed for entityVertex {}", entityVertex, npe); - throw new AtlasBaseException(AtlasErrorCode.UNKNOWN_SERVER_ERROR, npe, "mapVertexToAtlasEntityHeader: failed for entityVertex " + 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); From 4ab94f7992f89c57aa53cafb23baa79a051bb341 Mon Sep 17 00:00:00 2001 From: Suman Das <59254445+sumandas0@users.noreply.github.com> Date: Wed, 31 Jan 2024 12:30:48 +0530 Subject: [PATCH 2/2] re: add spacing --- .../atlas/repository/store/graph/v2/EntityGraphRetriever.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 18111068f7..390036d477 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 @@ -1047,7 +1047,7 @@ 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); + throw new AtlasBaseException(AtlasErrorCode.UNKNOWN_SERVER_ERROR, npe, "mapVertexToAtlasEntityHeader: failed for entityVertex with id " + id); } finally { RequestContext.get().endMetricRecord(metricRecorder);