From e93359b6c506d4c02ee55e351c98c62995ee090f Mon Sep 17 00:00:00 2001 From: hr2904 Date: Mon, 2 Dec 2024 16:36:27 +0530 Subject: [PATCH] PR refactor --- .../main/java/org/apache/atlas/tasks/TaskRegistry.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/repository/src/main/java/org/apache/atlas/tasks/TaskRegistry.java b/repository/src/main/java/org/apache/atlas/tasks/TaskRegistry.java index d405a900c6..5544c035e9 100644 --- a/repository/src/main/java/org/apache/atlas/tasks/TaskRegistry.java +++ b/repository/src/main/java/org/apache/atlas/tasks/TaskRegistry.java @@ -17,6 +17,7 @@ */ package org.apache.atlas.tasks; +import com.datastax.oss.driver.shaded.fasterxml.jackson.core.JsonProcessingException; import com.datastax.oss.driver.shaded.fasterxml.jackson.databind.ObjectMapper; import org.apache.atlas.AtlasConfiguration; import org.apache.atlas.RequestContext; @@ -498,9 +499,12 @@ private void repairMismatchedTask(AtlasTask atlasTask, String docId) { } else { LOG.info("No documents updated in Elasticsearch for guid: " + atlasTask.getGuid()); } - } catch (Exception e) { - e.printStackTrace(); + } catch (JsonProcessingException e) { + LOG.error("Error converting fieldsToUpdate to JSON for task with guid: {} and docId: {}. Error: {}", atlasTask.getGuid(), docId, e.getMessage(), e); } + catch (AtlasBaseException e) { + LOG.error("Error executing Elasticsearch query for task with guid: {} and docId: {}. Error: {}", atlasTask.getGuid(), docId, e.getMessage(), e); + } } public void commit() {