Skip to content

Commit 5f71490

Browse files
authored
fix:[NEXT-1893] Skip the AssetType if the ES throws exception (#2381)
1 parent 591ee0b commit 5f71490

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

jobs/pacman-data-shipper/src/main/java/com/tmobile/cso/pacman/datashipper/es/ESManager.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ public static void configureIndexAndTypes(String ds, List<Map<String, String>> e
452452
* @param filters the filters
453453
* @return the existing info
454454
*/
455-
public static Map<String, Map<String, String>> getExistingInfo(String indexName, String type, List<String> filters) {
455+
public static Map<String, Map<String, String>> getExistingInfo(String indexName, String type, List<String> filters) throws Exception {
456456
int count = getTypeCount(indexName, type);
457457
int _count = count;
458458
boolean scroll = false;
@@ -499,7 +499,7 @@ public static Map<String, Map<String, String>> getExistingInfo(String indexName,
499499
* @return the string
500500
*/
501501
private static String fetchDataAndScrollId(String endPoint, Map<String, Map<String, String>> _data, String keyField,
502-
String payLoad) {
502+
String payLoad) throws Exception {
503503
try {
504504
ObjectMapper objMapper = new ObjectMapper();
505505
Response response = invokeAPI("GET", endPoint, payLoad);
@@ -519,8 +519,9 @@ private static String fetchDataAndScrollId(String endPoint, Map<String, Map<Stri
519519
return scrollId;
520520
} catch (ParseException | IOException e) {
521521
LOGGER.error("Error in fetchDataAndScrollId", e);
522+
throw new Exception("Error in Fetching existing data from ES "+e);
523+
522524
}
523-
return "";
524525
}
525526

526527
/**

jobs/pacman-data-shipper/src/test/java/com/tmobile/cso/pacman/datashipper/entity/EntityManagerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class EntityManagerTest {
3636

3737
@SuppressWarnings("unchecked")
3838
@Test
39-
public void uploadEntityDataTest() {
39+
public void uploadEntityDataTest() throws Exception {
4040

4141
PowerMockito.mockStatic(ConfigManager.class);
4242
List<String> types = new ArrayList<>();

0 commit comments

Comments
 (0)