diff --git a/src/main/java/com/vinted/kafka/connect/vespa/feeders/VespaFeederHandler.java b/src/main/java/com/vinted/kafka/connect/vespa/feeders/VespaFeederHandler.java index 627cd27..c28c7ff 100644 --- a/src/main/java/com/vinted/kafka/connect/vespa/feeders/VespaFeederHandler.java +++ b/src/main/java/com/vinted/kafka/connect/vespa/feeders/VespaFeederHandler.java @@ -3,7 +3,6 @@ import ai.vespa.feed.client.DocumentId; import ai.vespa.feed.client.OperationParseException; import ai.vespa.feed.client.Result; -import ai.vespa.feed.client.ResultParseException; import com.fasterxml.jackson.core.JsonParseException; import com.vinted.kafka.connect.vespa.VespaReporter; import com.vinted.kafka.connect.vespa.VespaSinkConfig; @@ -107,11 +106,11 @@ private static boolean isMalformed(Throwable throwable) { .findFirst() .orElse(throwable); - String rootCauseString = rootCause.toString().toLowerCase(); + String throwableString = throwable.toString().toLowerCase(); - return !(rootCause instanceof ResultParseException) - && (rootCauseString.contains("status 400") - || rootCauseString.contains("string field value contains illegal code point") + return !(throwableString.contains("resultparseexception")) + && (throwableString.contains("status 400") + || throwableString.contains("string field value contains illegal code point") || rootCause instanceof OperationParseException || rootCause instanceof JsonParseException); }