Skip to content

Commit

Permalink
Merge pull request #2845 from atlanhq/throw-e
Browse files Browse the repository at this point in the history
fix: throw the error instead of creating a new one
  • Loading branch information
sumandas0 authored Feb 13, 2024
2 parents 3f39583 + 92b0356 commit bcb4bf8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit bcb4bf8

Please sign in to comment.