Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: throw the error instead of creating a new one #2845

Merged
merged 2 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading