From f9de741005eabb8d705aad982bd72663ac46a4fa Mon Sep 17 00:00:00 2001 From: Evaldas Buinauskas Date: Mon, 18 Dec 2023 12:30:46 +0200 Subject: [PATCH] Do not treat result parse exception as malformed --- .../kafka/connect/vespa/feeders/VespaFeederHandler.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 ff2de41..627cd27 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,6 +3,7 @@ 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; @@ -108,10 +109,11 @@ private static boolean isMalformed(Throwable throwable) { String rootCauseString = rootCause.toString().toLowerCase(); - return rootCauseString.contains("status 400") + return !(rootCause instanceof ResultParseException) + && (rootCauseString.contains("status 400") || rootCauseString.contains("string field value contains illegal code point") || rootCause instanceof OperationParseException - || rootCause instanceof JsonParseException; + || rootCause instanceof JsonParseException); } private static Result ignoredResult() {