Skip to content

Commit

Permalink
Merge 7a3971a into f9a15d3
Browse files Browse the repository at this point in the history
  • Loading branch information
lorthirk authored Apr 23, 2021
2 parents f9a15d3 + 7a3971a commit c50502a
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.ParseException;
import org.apache.http.util.EntityUtils;
import org.eclipse.kapua.commons.metric.MetricServiceFactory;
Expand Down Expand Up @@ -240,6 +241,10 @@ public BulkUpdateResponse upsert(BulkUpdateRequest bulkUpdateRequest) throws Cli
if (failureNode != null) {
failureMessage = failureNode.asText();
}
String reason = jsonNode.at("/error/reason").asText();
if (StringUtils.isNotBlank(reason)) {
failureMessage = reason;
}
bulkResponse.add(new UpdateResponse(metricId, new TypeDescriptor(indexName, typeName), failureMessage));
LOG.info("Upsert failed [{}, {}, {}]", indexName, typeName, failureMessage);
continue;
Expand Down

0 comments on commit c50502a

Please sign in to comment.