public List<OpBase> getHistory(ESRequest historyRequest)
throws IOException, ResourceNotFoundException, URISyntaxException {
String url = baseUrl + opIndex + "/_search";
String resp = makeESQuery(historyRequest, url);
HistoryResponse historyResponse = objectMapper.readValue(resp, HistoryResponse.class);
List<OpBase> returnMsgList = new ArrayList<>();
historyResponse.tasks.tasks.forEach(editTaskMsgResponse -> {
Map<String, Object> msgObject = editTaskMsgResponse.source.msg;
String taskType = (String) msgObject.get("task_type");
EditTaskType editTaskType = EditTaskType.valueOf(taskType);
switch(editTaskType) {
case MIGRATE_PLACE: returnMsgList.add(objectMapper.readValue(
objectMapper.writeValueAsString(msgObject), MatchingTaskOperatorMetricsMsg.class));
case CURATE_PLACE:
case QC_PLACE: returnMsgList.add(objectMapper.readValue(objectMapper.writeValueAsString(msgObject),
MatchingTaskOperatorMetricsMsg.class));
}
});
return returnMsgList;
}
I get an unhandled IOException exception error with lines like objectMapper.readValue(objectMapper.writeValueAsString(msgObject),
MatchingTaskOperatorMetricsMsg.class));
But I am explicitly saying this method throws this exception?