Skip to content

Commit

Permalink
Do not treat result parse exception as malformed
Browse files Browse the repository at this point in the history
  • Loading branch information
buinauskas committed Dec 18, 2023
1 parent 0e93214 commit f9de741
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit f9de741

Please sign in to comment.